1

I want to configure Jenkins to build my code on 1 server. Then want to deploy it on another server using Jenkins.Both servers are using Linux I want to automate the entire process as much as possible. I went through some of plugins like pipeline, Job Import Plugin, etc Can anyone guide me how to go about it ? Which plugins will be useful ? Any example or tutorial somewhere will be useful. The configuration of build pipeline plugin on jenkins was not seamless for me.

Thanks, Bhargav

bhargav
  • 267
  • 3
  • 8
  • 17
  • Jenkin has lot of plugins to deploy the EAR/WAR to remote application servers like, weblogic, websphere,tomcat etc. Which application server you are using? pipeline and job import plugins will not help you to deploy the application. – Dipu H Feb 07 '14 at 08:25
  • Thanks Dipu for the reply. Will be Using jboss application server. Deployment is not the only problem. Want to build on 1 server, and use the same code for deployment on another server using jenkins. – bhargav Feb 07 '14 at 08:46

1 Answers1

3

I would work it this way :

  1. Install jenkins on your first server

  2. Install the following plugins : ssh credentials, ssh slaves, copy to slave, and restart jenkins

  3. Go to Manage jenkins -> Manage credentials, and add ssh credentials for your second server

  4. Go to Manage jenkins -> Manage nodes, and create a passive slave. The launch method should be "Launch slave agents on Unix machines via ssh". You should use the credentials that you have added in step 3

  5. Create a job to build your code. In the advanded options of job, you should indicate that the job must only be built on master node.

  6. Create a job to deploy your code on the second server. In the avanded options of job, you should indicate that the job must only be built on slave node.

    In the "Build Environment" section, check the "Copy files into workspace before building" box and configure what files you want to copy from first server (https://wiki.jenkins-ci.org/display/JENKINS/Copy+To+Slave+Plugin)

The code will be copied into the jenkins slave's workspace.