在多个平台上运行
romp的Python项目详细描述
在多个平台上运行
我使用pip-tools但也希望保留对多个 平台。而不是在计算机之间共享目录 在我选择创建romp的文件周围穿梭,这将允许我提交 任意工作到Azure Pipelines以访问多个平台。 就我个人而言,我将主要在boots后面使用这个。
下面是一个使用示例。它将在64位linux下运行单个作业 赛顿3.6。作业将执行echo red > blue.txt,并收集 *.txt从作业保存到本地artifacts.tar.gz。
$ venv/bin/romp --platform linux --interpreter cpython --version 3.6 --architecture x86_64 --command 'echo red > blue.txt' --artifact-paths '*.txt' --artifact artifacts.tar.gz Requesting build Waiting for build: https://dev.azure.com/altendky/f1722f91-62fe-4a15-8937-252c96b31292/_build/results?buildId=2938 Handling artifact
由于romp利用Azure Pipelines访问所有平台, 需要服务器端安装程序。你需要一个azure帐户并创建 使用romprepository(官方)在该帐户中生成管道 或者你自己的叉子)。配置要使用的管道 deployed_ci/azure/azure-pipelines-lock.yml。其配置为 提交不会触发生成。romp自己的ci和测试由 azure-pipelines.yml在项目根目录中,但此文件可以忽略 经常使用。安装管道后,您将需要在运行romp时使用create a Personal Access Token (PAT)进行身份验证。拍拍 将需要启用生成读取和执行作用域。
对于本地设置,可以通过环境变量设置命令行选项。 对许多选择来说,这是没有意义的,但对少数人来说,这是有意义的。明确地 考虑以下选项,这些选项通常对所有通话都是一致的。
- ROMP_BUILD_REQUEST_URL
- 'https://dev.azure.com/altendky/romp-on/_apis/build/builds?api-version=5.0'
- ROMP_DEFINITION_ID
- 5
- ROMP_PERSONAL_ACCESS_TOKEN
- fp6al3jxta2zliz6rh5hr6ewd5nw2hsmasse2laiyoyg7otneqjq
- ROMP_USERNAME
- altendky
$ venv/bin/romp --help Usage: romp [OPTIONS] Options: --personal-access-token, --pat TEXT A personal access token (PAT) with rights to initiate builds ($ROMP_PERSONAL_ACCESS_TOKEN) --build-request-url TEXT The URL for submitting a build request ($ROMP_BUILD_REQUEST_URL) [default: https:/ /dev.azure.com/altendky/romp/_apis/build/bui lds?api-version=5.0] --command TEXT The command to be run for each target ($ROMP_COMMAND) [default: python -c 'import sys; print(sys.version); print(sys.platform)'] --username TEXT Username for build URL authentication ($ROMP_USERNAME) [default: altendky] --environments TEXT Targets to run on. Mostly use the matrix options instead. This may be removed. ($ROMP_ENVIRONMENTS) --check-period INTEGER The period used to poll the build for completion ($ROMP_CHECK_PERIOD) [default: 15] --source-branch TEXT The romp source branch to use for the build ($ROMP_SOURCE_BRANCH) [default: develop] --definition-id INTEGER The definition id of the build to be triggered ($ROMP_DEFINITION_ID) [default: 3] --archive-file FILENAME The archive to be uploaded to the build ($ROMP_ARCHIVE) --artifact FILENAME The path at which to save the resulting artifact ($ROMP_ARTIFACT_PATH) --artifact-paths TEXT Paths on remote system to build the artifact archive from. Wildcards are supported via bash. ($ROMP_ARTIFACT_PATHS) --platform [Linux|macOS|Windows] Platforms to matrix across ($ROMP_MATRIX_PLATFORMS) [default: Linux, macOS, Windows] --interpreter [CPython|PyPy] Interpreters to matrix across ($ROMP_MATRIX_INTERPRETERS) [default: CPython, PyPy] --version [2.7|3.4|3.5|3.6|3.7] Versions to matrix across ($ROMP_MATRIX_VERSIONS) [default: 2.7, 3.4, 3.5, 3.6, 3.7] --architecture [x86|x86_64] Architectures to matrix across ($ROMP_MATRIX_ARCHITECTURES) [default: x86, x86_64] --include <PLATFORM INTERPRETER VERSION ARCHITECTURE> Complete environments to include in the matrix ($ROMP_MATRIX_INCLUDES) --exclude <PLATFORM INTERPRETER VERSION ARCHITECTURE> Complete environments to exclude from the matrix ($ROMP_MATRIX_EXCLUDES) --archive-paths-root DIRECTORY Files in the uploaded archive will be stored with paths relative to this path. ($ROMP_ARCHIVE_PATHS_ROOT) --archive-path TEXT Files to include in the archive which will be extracted prior on the remote system prior to running the remote command. ($ROMP_ARCHIVE_PATHS) --verbose Increase logging verbosity by up to 2 levels ($ROMP_VERBOSITY) --help Show this message and exit.