如何在Jenkins中编写多个上游项目的推广作业?

发布于 2024-12-20 12:19:02 字数 401 浏览 0 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

﹏半生如梦愿梦如真 2024-12-27 12:19:02

当促销运行时,会在促销期间创建两个引用原始作业的变量。它们是:

  • PROMOTED_JOB_NAME:原始作业的名称。
  • PROMOTED_NUMBER:原始作业的原始内部版本号。

您可以在促销附加的操作中使用这些来引用原始职位。我将它们与 Copy Artifacts 插件一起使用,从原始版本中检索存档文件,然后执行复制到网络、发布等操作。

When a promotion runs, there are two variables created during the promotion that refer back to the original job. They are:

  • PROMOTED_JOB_NAME: The name of the original job.
  • PROMOTED_NUMBER: The original build number of the original job.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文