Cleanup Jenkins init scripts
[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     gerrit_host=gerrit.example.org
16     ciman_root=/opt/ciman
17
18     until host $gerrit_host &>/dev/null ; do
19         echo "Waiting until $gerrit_host is resolvable..."
20         sleep 1
21     done
22
23     git clone --recurse-submodules https://$gerrit_host/r/ci-management $ciman_root
24
25     # Specify swapspace on the minion
26     # SWAP_SIZE specifies the size of swapspace in GB If set to '0' no
27     # swapspace will be allocated If unset, 1GB swapspace will be
28     # allocated
29     #export SWAP_SIZE=0
30
31     $ciman_root/global-jjb/jenkins-init-scripts/init.sh
32
33     rm -rf $ciman_root