Jenkins : how to check out artifact from Nexus and Deploy on Tomcat-

前端 未结 4 1317
鱼传尺愫
鱼传尺愫 2020-12-14 02:09

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 st

4条回答
  •  不思量自难忘°
    2020-12-14 03:05

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

    enter image description here

    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.

提交回复
热议问题