0
votes

I am using Jenkins for continuous build for java projects and i am using deploy plugin,it takes a war/ear file and deploys that to a running remote application server at the end of a build successful. I am stuck at one scenario of deployment,if my new build fails then we have to push rollback version of build to a tomcat,i am using deploy plugin but there is no such options.

Could you please help me which plugin i have to use to push rollback version of a build on Tomcat in case of unstable build using Jenkins.

2

2 Answers

0
votes

I think the best way to handle this is to have a post-build step that would only be executed by successful builds, to copy the war/ear to someplace on the file system of the Jenkins instance. Then you'd have another post-build step for failed builds, that would do any upfront house-keeping of the Tomcat server and then deploy the last successful war/ear to that Tomcat instance.

0
votes

You can do build rollback with "copy artifact plugin" in Jenkins 2.x

You can create a Job where only stable build occurs. This isn't the actual rollback, but simplest strategy to implement stable build in final phase. (Say, STAGING/PRODUCTION environment)