Chore: Upgrade Jenkins-job-builder to 6.3.0
[releng/global-jjb.git] / jenkins-init-scripts / README
1 The files in this directory are for initializing a Jenkins minion just
2 before the cloud plugin hands the minion over to Jenkins.
3
4 The Jenkins 'init.sh' script will check for a project specific init
5 script: '$ciman_root/jenkins-init-scripts/local-init.sh'.  If the file
6 exits and is executable, it will be executed. Note the local init
7 script will be executed before the 'jenkins' user has been created.
8 You can also call a project specific script from the Jenkins Manged
9 File after the call to 'init.sh'.
10
11 To use this create a Jenkins Managed File with the contents:
12
13     #!/bin/bash
14
15     exec > /var/log/jenkins-init.log 2>&1
16
17     gerrit_host=gerrit.example.org
18     ciman_root=/opt/ciman
19
20     until host $gerrit_host &>/dev/null ; do
21         echo "Waiting until $gerrit_host is resolvable..."
22         sleep 1
23     done
24
25     git clone --recurse-submodules https://$gerrit_host/r/ci-management $ciman_root
26
27     # Specify swapspace on the minion
28     # SWAP_SIZE specifies the size of swapspace in GB If set to '0' no
29     # swapspace will be allocated If unset, 1GB swapspace will be
30     # allocated
31     #export SWAP_SIZE=0
32
33     $ciman_root/global-jjb/jenkins-init-scripts/init.sh
34
35     rm -rf $ciman_root
36
37     echo "jenkins-init: Done"