blob: 89a112449a62e1d530376041ace603085026c5c4 [file] [log] [blame]
Kailash Khalasi94d4b482018-06-28 15:37:11 -07001/*kubespray installation script test*/
2
3pipeline {
4
5 /* no label, executor is determined by JJB */
6 agent {
Zack Williamsb3292082019-10-11 17:15:18 -07007 label "${params.buildNode}"
Kailash Khalasi94d4b482018-06-28 15:37:11 -07008 }
9 stages {
10
Kailash Khalasiec8e2262018-07-11 12:03:24 -070011 stage ("Clean workspace") {
12 steps {
13 sh 'rm -rf *'
14 }
15 }
16
Kailash Khalasi94d4b482018-06-28 15:37:11 -070017 stage ("Parse deployment configuration file") {
18 steps {
Kailash Khalasi94d4b482018-06-28 15:37:11 -070019 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 Khalasiec8e2262018-07-11 12:03:24 -070036 sh """
Kailash Khalasi94d4b482018-06-28 15:37:11 -070037 pushd $WORKSPACE/automation-tools/kubespray-installer
Kailash Khalasia7187432018-07-16 10:34:06 -070038 ./setup.sh -i ${podName} ${deployment_config.node1.ip} ${deployment_config.node2.ip} ${deployment_config.node3.ip}
Kailash Khalasi94d4b482018-06-28 15:37:11 -070039 popd
Kailash Khalasiec8e2262018-07-11 12:03:24 -070040 """
Kailash Khalasi94d4b482018-06-28 15:37:11 -070041 }
42 }
43
44 stage ('Validate Kube Config File') {
45 steps {
Kailash Khalasiec8e2262018-07-11 12:03:24 -070046 sh """
Kailash Khalasia7187432018-07-16 10:34:06 -070047 pushd $WORKSPACE/automation-tools/kubespray-installer
Kailash Khalasiec8e2262018-07-11 12:03:24 -070048 ls -al
Kailash Khalasia7187432018-07-16 10:34:06 -070049 source setup.sh -s ${podName}
Kailash Khalasi94d4b482018-06-28 15:37:11 -070050 kubectl get pods
51 popd
Kailash Khalasiec8e2262018-07-11 12:03:24 -070052 """
Kailash Khalasi94d4b482018-06-28 15:37:11 -070053 }
54 }
55 }
56
57}