blob: 607a6c467021d28a8bd453867048d7148cf66918 [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 {
7 label "${params.executorNode}"
8 }
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
38 ./setup.sh -i flex-onf-pod1 ${deployment_config.node1.ip} ${deployment_config.node2.ip} ${deployment_config.node3.ip}
39 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 Khalasi94d4b482018-06-28 15:37:11 -070047 pushd $WORKSPACE/automation-tools/kubespray-installer/configs
Kailash Khalasiec8e2262018-07-11 12:03:24 -070048 ls -al
49 export KUBECONFIG=$WORKSPACE/automation-tools/kubespray-installer/configs/${deployment_config.pod_config}
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}