Jenkins:如何从Nexus中查看工件并在Tomcat- [英] Jenkins : how to check out artifact from Nexus and Deploy on Tomcat-

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

问题描述

我正在建立一个詹金斯管道。
第一阶段完成,代码编译,测试,检查并部署到Nexus。



我现在想在管道上做第二个阶段战争从Nexus检出并部署在tomcat上。



实际上,我已经将maven-tomcat插件集成到Tomcat上部署。
我的问题是如何查看战争的最新建设?



有没有任何maven或jenkins插件?



非常感谢,



Patrick

解决方案

您的二进制存储库管理器(Nexus)应该理想地占据您整体架构的以下位置:





您可以使用Jenkins作为配置工具,但最好应该启动某些进程,将工件直接从Nexus中部署(如果没有其他的更高效)。



这听起来容易得多。例如,可以从shell脚本调用Nexus REST API,以下载任何所需的工件修订版本。例如:

  $ CATALINA_HOME / bin / shutdown.sh 
curl -o $ CATALINA_HOME / webapps / myfile.war http://myrepo.com/service/local/artifact/maven/redirect?r=releases&g=com.myorg&a=myfile&v=1.1.1&e=war
$ CATALINA_HOME / bin / startup.sh

最后,也许您可​​能希望考虑一个专门的系统来管理您的部署?我一直在玩的一个有趣的解决方案是 rundeck ,它有一个插件,用于詹金斯。我真的很喜欢rundeck,因为它与Jenkins分享的简单性。 Nexus还有一个插件,可以让rundeck提供符合部署条件的下拉列表。 p>

I am tying to set up a Jenkins Pipeline. The first stage is done, the code compiles, is tested, inspected and deployed to Nexus.

I would like now to make a second stage on the pipeline where the war is checked out from Nexus and deployed on tomcat.

Actually I already integrated the maven-tomcat plugin to deploy on Tomcat. My question is how can I check out the latest build of the war ?

Is there any maven or jenkins plugin for that ?

Many thanks,

Patrick

解决方案

Your binary repository manager (Nexus) should ideally occupy the following position in you overall architecture:

You can use Jenkins as your provisioning tool, but ideally it should launch some sort of process which pulls the artifact to be deployed directly from Nexus (If nothing else it's more efficient).

This is a lot easier than it sounds. For example the Nexus REST API could be called from a shell script to download any desired revision of an artifact. For example:

$CATALINA_HOME/bin/shutdown.sh
curl -o $CATALINA_HOME/webapps/myfile.war http://myrepo.com/service/local/artifact/maven/redirect?r=releases&g=com.myorg&a=myfile&v=1.1.1&e=war
$CATALINA_HOME/bin/startup.sh

Finally, perhaps you might wish to consider a dedicated system for managing your deployments? An interesting solution I've been playing with is rundeck, which has a plugin for Jenkins. I really like rundeck, due to it's simplicity a trait it shares with Jenkins. There is also a plugin for Nexus that enables rundeck to provide a pull down list of artfacts eligible for deployment.

这篇关于Jenkins:如何从Nexus中查看工件并在Tomcat-的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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