在Hudson/Jenkins的工作中,如何从Nexus中选择工件? [英] How do I choose an artifact from Nexus in a Hudson / Jenkins job?

查看:107
本文介绍了在Hudson/Jenkins的工作中,如何从Nexus中选择工件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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).

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

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.

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

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.

我已经浏览了可用的Hudson&围绕Maven样式工件存储库的Jenkins插件,但它们似乎都更关心将工件推入存储库,而不是让它们退缩.

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.

我在其他作业中使用Hudson的复制工件"来从同一服务器上的其他Hudson作业中获取工件,但这在不同的Hudson服务器上不起作用,这就是为什么我转向Nexus(我们已经在使用了).

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).

有人有什么建议吗?

推荐答案

我建议使用 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.

这篇关于在Hudson/Jenkins的工作中,如何从Nexus中选择工件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆