用于创建和上载zip包的实用程序

release-manager的Python项目详细描述


ReleaseLicenseTravis

概述

release manager是一个python实用程序,可以轻松地上传压缩的 或目标目标的纯二进制文件。它允许您:

  • 创建新的软件包版本
  • 将工件上载到所述版本
  • 目前仅支持ZIP
  • 上载到多个目标
  • 当前支持Bintray和AWS S3
  • 将n个二进制文件合并到随后上载的工件中
  • 为包上载n个工件

安装

  • 选项1:下载此存储库并运行: python setup.py install
  • 选项2:从pip安装:pip install release-manager

用法

usage: release-manager.py [-h] [--config CONFIG] [--make-version]
                          [--make-artifact] [--upload-artifact]
                          [--check-version] [--version]

Bintray utility for creating and uploading zip packages.

optional arguments:
  -h, --help         show this help message and exit
  --config CONFIG    the path to the configuration yaml file
  --make-version     makes a new version for the package
  --make-artifact    makes the artifacts that will be uploaded
  --upload-artifact  uploads the artifacts to the targets
  --check-version    checks that the version specified matches the build
  --version          show program's version number and exit

请注意,当指定要运行的选项时,它们将被应用 到配置文件中的每个包。

选项:

  • 如果不同时生成工件,则无法上载工件:
  • --upload-artifact需要--make-artifact
  • 检查版本对于自动生成工具(如 travis断言您指定了正确的生成版本

配置

发布管理器要求以 yaml文件。您可以在resources目录中找到一个示例配置。

环境解析器

若要在运行时从环境中获取值,请将该值设置为 以下内容:

some_env_key: <%= ENV['SOME_ENV_VALUE'] %>

壳体分解器

要在运行时计算shell命令,请按如下方式设置值:

some_cmd_value: <%= CMD['cat VERSION'] %>

^ {STR 1 } $ Note :如果命令没有退出代码0,配置将不会 装载。

变量解析器

如果需要在配置中多次访问变量,则可以 要对其进行硬编码,可以使用局部变量解析器。

工作原理如下:

some_var_value: "hello_world"
some_ref_var_value: {{ some_var_value }}

函数分解器

Release Manager为您提供了一个(目前)预定义的功能- sbt_版本(路径)。使用它,您可以在 指定路径。

工作原理如下:

some_cmd_value: <%= FUNC['sbt_version(../scalaz)'] %>

示例配置
# Required: local settings
local:
  root_dir : <%= ENV['TRAVIS_BUILD_DIR'] %>

# Required: deployment targets
targets:
  - type     : "bintray" # Options: bintray
    user     : <%= ENV['BINTRAY_USER'] %>
    password : <%= ENV['BINTRAY_PASSWORD'] %>

# Required: packages to be deployed
packages:
  - repo     : "generic"
    name     : "release-manager"
    user_org : "jbeemster"
    publish  : true

    # Will attempt to overwrite a published entity if one is found
    override : false

    # If the artifact already exists will determine whether or not
    # to fail the release
    continue_on_conflict : false

    # The version of this package
    version  : <%= CMD['cat VERSION'] %>

    # Required IF '--check-version' is passed: will assert that
    # both versions are the same
    build_version : <%= ENV['TRAVIS_TAG'] %>

    # Optional: Build commands
    # You can nest your artifact creation commands here!
    build_commands:
      - ls -ls

    # Required: Artifact
    artifacts:
        # The artifact name is composed like so:
        # {{prefix}}{{version}}{{suffix}}.zip
      - prefix : "release_manager_"
        suffix : ""
        type   : "zip"

        # The binaries to put in the zip
        binary_paths:
          - setup.py

多个位置

如果您使用locations关键字而不是第一级bucketpathregion关键字,相同的工件可以上传到两个或多个bucket中,而不必使用不必要的样板文件。

packages:
  - name     : "acme-app-multiple-locations"
    locations:
    - bucket   : "acme-hosted-assets-us-east-1"
      path     : "software/acme-app"
      region   : "us-east-1"
    - bucket   : "acme-hosted-assets-us-west-1"
      path     : "software/acme-app"
      region   : "us-west-1"
    publish  : true
    override : false
    continue_on_conflict : false
    version  : "0.1.0"

请注意,如果您使用locationsarray-first levelbucketpathregion必须不存在。

AWS S3目标

除了bintray,您还可以将文件上传到amazon s3。

targets:
  - type     : "awss3" # Options: bintray
    user     : <%= ENV['AWS_ACCESS_KEY'] %>
    password : <%= ENV['AWS_SECRET_KEY'] %>

原样工件

除了zip工件,您还可以从本地fs上传纯文件。

artifacts:
  - prefix : "release_manager_"
    suffix : ""
    type   : "asis"

    binary_paths:
      - setup.py

文件setup.py将重命名为发布管理器{{version}并上载 进入指定路径。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java在Hibernate中使用条件连接两个表?   Stripes框架中的java对话范围   我的内存够吗?   Jenkins Java&Selenium如何处理2个随机异常?   javascript Java websockets跨端点共享会话   java是一种测试驱动的开发方法吗?   Java客户端中的Soap连接超时,但在SOAPUI中未超时   Java LibGDX:TileMap未在顶部和右侧渲染   linux Java::process builder:bash脚本:返回的文件名正确,但fileReader引发FileNotFoundException   java Selenium单击自动随机生成的DIV/ID/LINK   比较两个忽略元素和属性顺序的XMl文件   Java无限循环/调用   java如何防止操作修改cookie?   列出未保存的Java webpanel命令   在Java中,如何解决XXXX不能作为变量求解的错误?   Java概念后期版本格式化部分