0

I have a jenkins running on my local centos machine.

I have configured my local jenkins and was able to run a successful local build . Now, i want to run remote tests which are python scripts on a remote centos machine which is not having jenkins installed. also, i dont want to install any jenkins process on the remote linux system as it is "like a" production server and am advised not to install any apps on it. How do i use my local jenkins to run a build to execute those remote tests and report/output on my local jenkins console.

Do i need to use jenkins master-slave architecture ? if yes, how do i configure that given my above requirement.

gaganso
  • 2,914
  • 2
  • 26
  • 43
cool77
  • 1,086
  • 4
  • 15
  • 31
  • Please look at [this](https://wiki.jenkins-ci.org/display/JENKINS/Step+by+step+guide+to+set+up+master+and+slave+machines) – gaganso May 30 '16 at 10:43

2 Answers2

1

You might want to have a look at this: https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds

for you req, precisely this part: https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds#Distributedbuilds-Launchslaveagentheadlessly

However, i believe you still have to have java on your slave unix node to run the slave.jar on it

syntaxer
  • 26
  • 3
  • You are not probably correct. We can run builds remotely on slaves using ssh tools also. plz check the CI wiki properly. For that, it might just needed to install ssh plugin on jenkins server. – S.K. Venkat Jul 04 '16 at 18:36
1

This answer is assuming the scripts are in GitHub. May it helps to think in your case.

So.. First you need to install Git in you server machine by:

$ sudo apt-get update
$ sudo apt-get install git

Now you need to get the path of Git by $ which git

it will give like "/usr/local/bin/git"

copy that path into ManageJenkins->Global Tool Configuration-> in the git section, paste into "Path to Git executable".

it will allows you to access git sources.

Now you need to provive SSH keys.

Type sudo su- jenkins in you remote machine.You have to generate ssh key for "jenkins" user.

Now add public key to GitHub account(You can see https://www.youtube.com/watch?v=Vi-WqFKYpnw).

and add the private key to Jenkins by

  1. Go to Credentials
  2. Click in Global in Stores scoped
  3. Add Credentials
  4. Kind: SSH Username with private key
  5. Username: your server username
  6. Private Key: give the private key of user "Jenkins"
  7. Specify ID as "jenkins-private-key" or anything else to identify

Now Go to job configuration->select credentials that you have created and Copy the ssh url of repository(Where you scripts are stored) Now you can run the scripts which are stored in Git.

Jagadeesh
  • 358
  • 5
  • 17