How to add new JENKINS slave nodes (clients)
Set up the jenkins user on the client node
- Create the user
jenkins
on the node
Passwordless ssh from jenkins server configuration
- If not already done, on the jenkins server enter
ssh-keygen -t rsa
without specifying a password as user jenkins
Passwordless ssh from jenkins client configuration
-
mkdir /home/jenkins/.ssh
-
chmod 700 /home/jenkins/.ssh/
-
vim .ssh/authorized_keys
(<< copy here the content of cat .ssh/id_rsa.pub
run on jenkins server home)
-
chmod 640 .ssh/authorized_keys
-
service sshd restart (as root)
Create the node in Jenkins
- Point your browser to the jenkins instance:
http://ci-01.cnaf.infn.it:8080/
- Log in as admin and go to
Configura Jenkins -> Gestisci nodi
- Go to
New Node
- Insert node name and select the
Copy existing node
radio button. Specify the node to be copied eg. ci-02
- Modify the following fields according to your desiderata:
Name
, Description
, Labels (important for triggering builds on this node)
, Host
- Click on the Save button
- The user which performs ssh (jenkins) is already specified. If the node is created from scratch this is another option to be specified.
In order to trigger a build on the already created node, specify the corresponding label in the build options.
Enable package deployment to nexus
In order to publish artifacts in nexus, it is necessary to define a file on each build node under the jenkins user home directory. The file is ~jenkins/.m2/settings.xml and the content should be the following:
<settings>
<servers>
<server>
<id>sonatype-nexus-staging</id>
<username>jenkins</username>
<password>***</password>
</server>
</servers>
</settings>
The id is the one that must be specified in the pom.xml section for the deployment.
Install build packages
These packages are considered the minimum build environment. Install them on the slave node.
cmake bash bzip2 coreutils cpio diffutils fedora-release findutils gawk gcc gcc-c++ grep gzip info make patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux which xz
and
boost boost-devel createrepo