Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatic deployement with Jenkins/jetty

I would like to setup a continuous integration environment whereby after committing the source code, it triggers a build process that checks out the code, runs tests, constructs a war file and deploys the same to jetty server such that the users/testers can access the application on the browser.

Is this possible ?

Am using maven and jetty (I am not willing to change this. I use jetty both for development and in production). For CI, I am exploring Jenkins but am open to other opensource solutions.

If possible, how do I setup the environment.

like image 814
joshua Avatar asked Jun 06 '11 09:06

joshua


2 Answers

I found a maven plugin named cargo. It has everything that I needed. I added it into my pom so that I could deploy and undeploy using mvn cargo:deploy/mvn cargo:undeploy. I created a new jenkins job and added undeploy, package deploy maven goals as build steps. Everything is working perfectly.

like image 178
joshua Avatar answered Oct 09 '22 11:10

joshua


it's definitely possible. In a previous project, the build server (teamcity) copied the war to a shared nfs location between the build server and the application server and run a little shell script that connected to the application server and restarted jetty.

We used ant inside maven to manage the deployment, I remember we used the copy and sshexec tasks.

I'm sure that there are many other solutions, but that one worked for us.

like image 45
Augusto Avatar answered Oct 09 '22 13:10

Augusto