Kailash Khalasi | 94d4b48 | 2018-06-28 15:37:11 -0700 | [diff] [blame] | 1 | /*kubespray installation script test*/ |
| 2 | |
| 3 | pipeline { |
| 4 | |
| 5 | /* no label, executor is determined by JJB */ |
| 6 | agent { |
| 7 | label "${params.executorNode}" |
| 8 | } |
| 9 | stages { |
| 10 | |
Kailash Khalasi | ec8e226 | 2018-07-11 12:03:24 -0700 | [diff] [blame] | 11 | stage ("Clean workspace") { |
| 12 | steps { |
| 13 | sh 'rm -rf *' |
| 14 | } |
| 15 | } |
| 16 | |
Kailash Khalasi | 94d4b48 | 2018-06-28 15:37:11 -0700 | [diff] [blame] | 17 | stage ("Parse deployment configuration file") { |
| 18 | steps { |
Kailash Khalasi | 94d4b48 | 2018-06-28 15:37:11 -0700 | [diff] [blame] | 19 | sh returnStdout: true, script: 'git clone -b ${branch} ${configRepoUrl}' |
| 20 | script { deployment_config = readYaml file: "${configRepoBaseDir}${configRepoFile}" } |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | stage ('Checkout Automation-Tools Repo') { |
| 25 | steps { |
| 26 | sh ''' |
| 27 | pushd $WORKSPACE |
| 28 | git clone https://gerrit.opencord.org/automation-tools |
| 29 | popd |
| 30 | ''' |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | stage ('Install Kubespray on Nodes') { |
| 35 | steps { |
Kailash Khalasi | ec8e226 | 2018-07-11 12:03:24 -0700 | [diff] [blame] | 36 | sh """ |
Kailash Khalasi | 94d4b48 | 2018-06-28 15:37:11 -0700 | [diff] [blame] | 37 | pushd $WORKSPACE/automation-tools/kubespray-installer |
Kailash Khalasi | a718743 | 2018-07-16 10:34:06 -0700 | [diff] [blame] | 38 | ./setup.sh -i ${podName} ${deployment_config.node1.ip} ${deployment_config.node2.ip} ${deployment_config.node3.ip} |
Kailash Khalasi | 94d4b48 | 2018-06-28 15:37:11 -0700 | [diff] [blame] | 39 | popd |
Kailash Khalasi | ec8e226 | 2018-07-11 12:03:24 -0700 | [diff] [blame] | 40 | """ |
Kailash Khalasi | 94d4b48 | 2018-06-28 15:37:11 -0700 | [diff] [blame] | 41 | } |
| 42 | } |
| 43 | |
| 44 | stage ('Validate Kube Config File') { |
| 45 | steps { |
Kailash Khalasi | ec8e226 | 2018-07-11 12:03:24 -0700 | [diff] [blame] | 46 | sh """ |
Kailash Khalasi | a718743 | 2018-07-16 10:34:06 -0700 | [diff] [blame] | 47 | pushd $WORKSPACE/automation-tools/kubespray-installer |
Kailash Khalasi | ec8e226 | 2018-07-11 12:03:24 -0700 | [diff] [blame] | 48 | ls -al |
Kailash Khalasi | a718743 | 2018-07-16 10:34:06 -0700 | [diff] [blame] | 49 | source setup.sh -s ${podName} |
Kailash Khalasi | 94d4b48 | 2018-06-28 15:37:11 -0700 | [diff] [blame] | 50 | kubectl get pods |
| 51 | popd |
Kailash Khalasi | ec8e226 | 2018-07-11 12:03:24 -0700 | [diff] [blame] | 52 | """ |
Kailash Khalasi | 94d4b48 | 2018-06-28 15:37:11 -0700 | [diff] [blame] | 53 | } |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | } |