Adding a Slave node to Jenkins
This is a step-by-step instruction to add a slave node to Jenkins.
- Get a new server that runs Linux
- Set up a Jenkins user (you don't necessarily need Jenkins itself installed, but you need a dedicated user), with a home folder and proper permissions. Ideally, the user is called "jenkins" on both machines.
- Put the master's Jenkins SSH public key on the slave's Jenkins user authorized_keys
Adding the node to Jenkins
- Log into jenkins with an administrator account
- On the Home page, go to "Manage Jenkins", then "Manage Nodes"
- On the left, press "New Node"
- Enter a node name, then press "Dumb Slave", then OK
- Enter "1" as the number of executors (you probably don't want to build two devices at the same time)
- Enter your path to your jenkins user home in "Remote FS root" (e.g. "/var/lib/jenkins"). *Note:* This is not necessarily the folder where you'll build your ROM. In our case, our Jenkins data is stored in /var/lib/jenkins, while our builds are done in /home/build.
- Make sure Usage is set to "Utilize this slave as much as possible", and Launch method is set to "Launch slave agents on Unix machines via SSH"
- Below the Launch method drop-down, enter the slave's IP address in "Host", then press "Add" to create a new credential
- Select "SSH Username with private key" kind, enter the remote username (in our case, "jenkins"), and select Private key "From the Jenkins master ~/.ssh"
- If your key has a passphrase, press "Advanced" and type in the passphrase
- Press Save to close the dialog, and choose your new credential in the list
- Press Save again to save your node.
Your node is now setup! If connection can be made properly, you should see the slave's statistics appearing in the "Manage Nodes" page.