如何在Jenkins中编写多个上游项目的推广作业?
我在 jenkins 中有很多构建项目(几个项目,每个项目都有多个分支),我想启用它们进行升级(使用升级插件)。
对于所有不同的工作,晋升过程几乎都是相同的。因此,我不想在每个构建项目中编写所有升级步骤,而是希望有一个能够升级它们的单个升级工作。
在我看来,用户会从任一构建项目中手动选择并升级一个构建。该构建将触发升级作业的新构建,该构建从升级的构建中检索信息并进行升级。
我的问题是,我似乎没有找到从升级版本中检索工件的方法。
如果我使用复制工件插件,它会迫使我选择一项上游工作,而且我似乎无法编写多个工作。帮助说我可以使用 $ 变量,但我不知道如何使用,因为我在环境变量中没有看到升级的构建 id。
我很确定这个问题可以解决,但我不知道如何解决。
有人有主意吗?
谢谢。
I have quite many build projects in jenkins (several projects with several branches each), I would like to enable them for promotion (using the promotion plugin).
The promotion process would be pretty much the same for all the different jobs. So I wouldn't like to write all the promotion steps in each of the build projects, but rather have a single promotion job, able to promote them.
The way I see it a user would manually select and promote one build from either build project. the build would trigger a new build of the promotion job, which retrieves the information from the promoted build and does the promotion.
My problem is that I don't seem to see a way to retrieve the artifacts from the promoted build.
If I use the copy artifact plugin it forces me to choose an upstream job, and I seem not to be able to write more than one. The help says that I can use the $ variables, but I don't see how, as I don't see the promoted build id among the environment variables.
I'm pretty sure this could be solved, but I don't see how.
Anyone has an idea?
thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当促销运行时,会在促销期间创建两个引用原始作业的变量。它们是:
您可以在促销附加的操作中使用这些来引用原始职位。我将它们与 Copy Artifacts 插件一起使用,从原始版本中检索存档文件,然后执行复制到网络、发布等操作。
When a promotion runs, there are two variables created during the promotion that refer back to the original job. They are:
You can use these in actions attached to the promotion to reference the original job. I use them with the Copy Artifacts plugin to retrieve archived files from the original build, then do things like copy to the network, publish, etc.