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 | |
| 11 | stage ("Parse deployment configuration file") { |
| 12 | steps { |
| 13 | sh returnStdout: true, script: 'rm -rf ${configRepoBaseDir}' |
| 14 | sh returnStdout: true, script: 'git clone -b ${branch} ${configRepoUrl}' |
| 15 | script { deployment_config = readYaml file: "${configRepoBaseDir}${configRepoFile}" } |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | stage ('Checkout Automation-Tools Repo') { |
| 20 | steps { |
| 21 | sh ''' |
| 22 | pushd $WORKSPACE |
| 23 | git clone https://gerrit.opencord.org/automation-tools |
| 24 | popd |
| 25 | ''' |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | stage ('Install Kubespray on Nodes') { |
| 30 | steps { |
| 31 | sh ''' |
| 32 | pushd $WORKSPACE/automation-tools/kubespray-installer |
| 33 | ./setup.sh -i flex-onf-pod1 ${deployment_config.node1.ip} ${deployment_config.node2.ip} ${deployment_config.node3.ip} |
| 34 | popd |
| 35 | ''' |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | stage ('Validate Kube Config File') { |
| 40 | steps { |
| 41 | sh ''' |
| 42 | pushd $WORKSPACE/automation-tools/kubespray-installer/configs |
| 43 | #Validate the conf file |
| 44 | export KUBECONFIG=$WORKSPACE/automation-tools/kubespray-installer/configs${deployment_config.pod_config} |
| 45 | kubectl get pods |
| 46 | popd |
| 47 | ''' |
| 48 | } |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | } |