Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins Remote Deployments

We're trying to setup Jenkins, but we are having a couple issues.

We have a "Jenkins Server" (Master) and have connected it to Fisheye. Jenkins is able to get the Git repo and run the tests.

Is there some kind of built in process for Jenkins to give it capabilites to SSH into a server and run commands like "git pull origin master" ?

like image 889
Michael Avatar asked Jan 27 '12 21:01

Michael


People also ask

Can Jenkins be used for deployment?

Jenkins is an all-purpose automation tool that was designed for Continuous Integration. It can run scripts, which means it can do anything you can script, including deployment.

Can Jenkins Deploy to multiple servers?

You can deploy to multiple servers using the Node and Label parameter plugin. Add the servers you want to deploy your code using Jenkins nodes: Manage Jenkins > Manage nodes > New node. Be sure to add a label to each node so you can group them together and deploy to that group.


2 Answers

Yes there is ssh capabilities in Jenkins. You can add a build step for either running SSH or sending files over SSH (you have to define target server in config). Theres also a post build plugin for sending artifacts over ssh which can be used to also execute remote commands.

I'd recommend a book by John Smart which covers Jenkins setup. Its at http://www.wakaleo.com/books/jenkins-the-definitive-guide

like image 71
jimnz111 Avatar answered Oct 04 '22 23:10

jimnz111


I think you want the SSH Plugin for Jenkins. This will let you define SSH servers in your global configuration, and then define commands to be run before and after the build.

like image 37
recampbell Avatar answered Oct 04 '22 23:10

recampbell