gpt4 book ai didi

jenkins - 如何使用 Pipeline Job 的 CopyArtifact 插件传递从中复制工件的内部版本号?

转载 作者:行者123 更新时间:2023-12-02 04:10:43 25 4
gpt4 key购买 nike

如何传递在管道作业中复制工件的内部版本号?因为默认此步骤从最后一个稳定版本复制工件,并且我需要从特定版本(例如 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com