如何在 Hudson / Jenkins 作业中从 Nexus 选择工件?

发布于 2024-12-09 04:04:03 字数 623 浏览 0 评论 0原文

我在 Hudson 服务器 A 中有一份工作,它构建一个工件并将其部署到 Nexus。我在完全独立的 Hudson 服务器 B 中有另一项工作,需要下载工件并部署它。该作业通常是手动运行的,运行它的人需要指示要部署哪个版本的工件 - 他们可能并不总是想要部署最新版本(例如,回滚到以前已知的良好版本)。

目前,我通过使用参数化构建来实现这一点,并要求用户传入工件版本号;然后,该作业使用执行 shell 构建步骤在使用该参数构建的 URL 上运行 wget。这很容易出错。

理想情况下,我想要一个插件,让用户可以浏览 Nexus 存储库中的工件版本,并选择要部署的版本,但我愿意接受其他建议。一个也能处理下载的插件会很好,但是只要我仍然可以获得可以在 shell 命令中使用的字符串,我就可以没有它。

我浏览了可用的 Hudson & Jenkins 插件围绕 Maven 风格的工件存储库,但它们似乎都更关心将工件推送到存储库中,而不是让它们返回。

我在其他作业中使用 Hudson 的“复制工件”,以从同一服务器上的其他 Hudson 作业获取工件,但这在不同的 Hudson 服务器上不起作用,这就是我转向 Nexus 的原因(我们正在使用 Nexus)反正已经在使用了)。

有人有什么建议吗?

I have a job in Hudson server A which builds an artifact and deploys it to Nexus. I have another job in a completely separate Hudson server B which needs to download the artifact and deploy it. This job is normally run manually, and the person running it needs to indicate which version of the artifact to deploy - they may not always want to deploy the latest version (e.g. to roll back to a previous known good version).

Currently, I achieve this by using a parameterized build, and require the user to pass in the artifact version number; the job then uses the Execute shell build step to run wget on a URL constructed using the parameter. This is error prone.

Ideally I'd like a plugin that lets the user browse the artifact versions in the Nexus repository and pick and choose the one to deploy, but I'm open to other suggestions. A plugin that also handles the download would be nice, but I can live without it as long as I can still get a string that I can use in shell commands.

I've looked through the available Hudson & Jenkins plugins around Maven style artifact repositories, but they all seem more concerned with pushing artifacts into repos rather than getting them back down.

I'm using Hudson's "Copy Artifact" in other jobs, to get artifacts from other Hudson jobs on the same server, but this doesn't work across different Hudson servers, which is why I've turned to Nexus (which we're already using anyway).

Does anyone have any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

停滞 2024-12-16 04:04:04

我建议使用 rundeck 来执行部署。

I recommend using rundeck to execute your deployments.

  • There is a rundeck plugin for Nexus that enables rundeck to display a pull down menu of available versions in Nexus.
  • There is a rundeck plugin for Jenkins that can be used to invoke deployments using rundeck and kick-off post deployment jobs (like integration testing) inn Jenkins.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文