Balistick
Balistick

Reputation: 33

Continuous integration server beginner

I'm trying to setup a complete CI server, but I struggle on some points.

Currently, my system work as follow :

I don't really know if this process is fine, but i guess so...

My problem is that I want to deliver the versionned artifact in my nexus repo (say "artifact-v0000001.war") in my production tomcat. But I can't figure out how to do it.

When I do "mvn release:prepare release:perform tomcat:deploy" it deploys the new SNAPSHOT artifact built ... I don't want to do this, I want to reuse the artifact from the nexus repository.

Is there a way to doing this using a tool (maven/jenkins plugin, or external)?

Basically, I want to fetch the last release artifact on the repository, and send it to the tomcat manager for dereploying the webapp.

Do I need to setup a delivery job separated from the release job?

Upvotes: 2

Views: 1028

Answers (2)

Ari Maniatis
Ari Maniatis

Reputation: 8668

Your problem is that you are probably using the Jenkins release plugin, not the "m2 release plugin". The problem with the standard plugin is that it performs the regular build, saves the artifacts, then performs the release. It will then try to deploy the wrong artifacts that it created from the regular build.

The m2 release plugin solves this particular problem. There are some tricky workaround for this problem, but that's how it stands at the moment until this feature is implemented: https://issues.jenkins-ci.org/browse/JENKINS-11120 (log in and vote for it!)

Upvotes: 0

Feasoron
Feasoron

Reputation: 3600

Jenkins, especially when combined with a tool like ANT, can do just about anything. It has a lot of plug-ins, and you can always write a script and incorporate it into a Jenkins build. Currently, I use Jenkins to deploy web applications to Windows IIS servers. What you could do here is have a Jenkins build that has your SVN path set in the source control section so that it fetches the latest version when you trigger the build. From there it should be fairly trivial to write an ANT script that copies it over the existing JAR in Tomcat, which will automatically restart it.

Upvotes: 0

Related Questions