【发布时间】:2021-07-31 10:25:56
【问题描述】:
我有两份工作:
- 构建作业
- 部署作业
我将第一个作业中生成的工件(jar)复制到第二个作业中,并将它们部署到环境中。
properties([
parameters(
[
string(
name: 'buildnumber',
description: 'Buildnumber to deploy'
),
choice(
name: 'env',
choices: ['qa', 'stage', 'prod'],
description: 'Environment where the app should be deployed'
)
]
)
])
node{
stage('Copy artifacts'){
copyArtifacts(projectName: 'my-demo-build-job/master', selector: specific(params.buildnumber))
}
stage('Deploy'){
sh 'Deploying to the specified environment '
}
}
有了这个,我必须手动检查最新/成功的构建并将其作为参数。有没有一种方法可以让我们获得一个下拉列表,其中包含所有按内部版本号排序的成功构建作为其他作业的选择器?
【问题讨论】:
标签: jenkins continuous-integration jenkins-pipeline jenkins-plugins jenkins-groovy