YAML模式
2022世界杯阿根廷预选赛赛程resources:—name:type:镜像配置:registry: sourceRepository: < artifactory repo的名称> #如果注册表是artifactory region: #如果注册表是AWS imageName: imageTag: autoPull: #(默认为true) pin: versionId: imageTag:
标签
的名字
一个字母数字标识资源的字符串(允许使用下划线)。
类型
必须图像
对于此资源类型。
配置
指定资源的所有配置选择。
标签 |
描述 |
必需的/可选 |
---|---|---|
注册表 |
的名称Docker注册表集成 | 要求 |
sourceRepository |
Artifactory中图像将发布到的存储库的名称。当管道配置为使用JFrog CLI v1时,需要在Artifactory中的Docker镜像。 当管道配置为使用JFrog CLI v2时,不使用此选项。 |
如果注册表在JFrog Artifactory中,使用JFrog CLI v1,则必须 |
地区 |
一个AWS区域标识符 |
如果注册表在AWS上,则必须 |
imageName |
Docker映像的文件路径,格式为imageRepo/imageName 一旦一个 如果
|
要求 |
imageTag |
Docker映像的初始版本的版本标记 | 要求 |
autoPull |
默认为真正的.图像将自动拉到运行该步骤的机器上。 |
可选 |
销 |
此配置可用于将资源固定到特定版本。固定资源版本将被引用此资源作为输入的步骤使用,更新的版本将被忽略。 用户在选择要固定的镜像资源版本时有两个配置选项:
或
使用该资源作为输出的步骤仍然可以生成新版本。对于使用该资源作为输入的步骤,新版本将是可见的,只要它们是创建该版本的步骤的同一运行的一部分。 当创建一个新的运行时,手动自定义触发器仍然可以用来覆盖固定的版本到不同的版本。 |
可选 |
环境变量
每当图像
在步骤中使用时,将自动提供一组可在步骤中使用的环境变量。
环境变量 |
描述 |
---|---|
res_ < resource_name > _name |
资源名称 |
res_ < resource_name > _sourceRepository |
Artifactory中存储库的名称 |
res_ < resource_name > _region | AWS区域标识符 |
res_ < resource_name > _imageName | Docker映像的文件路径 |
res_ < resource_name > _imageTag | Docker映像的初始版本的版本标记 |
res_ < resource_name > _autoPull | autopull标志的值 |
例子
本例的管线DSL可在t他的仓库在JFrogGitHub帐户。
示例1
2022世界杯阿根廷预选赛赛程resources:—name: Image_1 type:镜像配置:registry: PSSG_DockerRegistry imageName: docker/jfreq_win imageTag:最新管线:—name: pipelines_Image_1 steps:—name: step_Image_1 type: PowerShell configuration: nodePool: win_2019 inputResources:—name: Image_1 execution: onExecute:—write-output " execution step…"- if($Image_1_isTrigger -ne "true"){写错误"Stop" - erroraction Stop}
示例2
2022世界杯阿根廷预选赛赛程resources:—name: Image_2 type:镜像配置:registry: s_artifactory sourceRepository: docker-local imageName: ubuntu imageTag:最新管线:—name: pipelines_IMAGE_2 steps:—name: step_IMAGE_2 type: PowerShell配置:nodePool: win_2019 inputResources:—name: Image_2 execution: onExecute: - write-output " execution step…"