如何传递在管道作业中复制工件的内部版本号? 因为默认此步骤从最后一个稳定版本复制工件,并且我需要从特定版本(例如 123)复制工件。
我的管道代码在这里:
node {
stage "Copy artifacts"
step ([$class: 'CopyArtifact',
projectName: 'other-project',
filter: 'myapp.jar']);
}
最佳答案
来自官方博客post :
All other config options that the copyartifact-plugin supports are also available. The easiest way to test/browse all options is through the Workflow script “Snippet Generator” (available on the workflow configuration screen below the workflow script textarea).
如果可以参数化,内置的“片段生成器”中应该有适当的选项。
要从特定版本复制工件,您需要额外使用selector
参数:
node {
stage "Copy artifacts"
step ([$class: 'CopyArtifact',
projectName: 'other-project',
filter: 'myapp.jar',
selector: [$class: 'SpecificBuildSelector', buildNumber: '1']
]);
}
关于jenkins - 如何使用 Pipeline Job 的 CopyArtifact 插件传递从中复制工件的内部版本号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36872752/