Suchitra Vemuri | ddb2779 | 2018-08-23 15:29:42 -0700 | [diff] [blame] | 1 | // Copyright 2017-present Open Networking Foundation |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
Suchitra Vemuri | ddb2779 | 2018-08-23 15:29:42 -0700 | [diff] [blame] | 15 | node ("${TestNodeName}") { |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 16 | timeout (100) { |
| 17 | try { |
| 18 | stage ("Parse deployment configuration file") { |
| 19 | sh returnStdout: true, script: "rm -rf ${configBaseDir}" |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 20 | sh returnStdout: true, script: "git clone -b ${branch} ${cordRepoUrl}/${configBaseDir}" |
You Wang | 59ded6c | 2018-10-05 17:43:44 -0700 | [diff] [blame] | 21 | deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}.yaml" |
Suchitra Vemuri | ddb2779 | 2018-08-23 15:29:42 -0700 | [diff] [blame] | 22 | } |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 23 | stage('Clean up') { |
| 24 | timeout(10) { |
| 25 | sh returnStdout: true, script: """ |
| 26 | rm -rf helm-charts cord-tester |
You Wang | d6c5e8c | 2018-08-29 12:49:51 -0700 | [diff] [blame] | 27 | git clone -b ${branch} ${cordRepoUrl}/helm-charts |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 28 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Luca Prete | 5a97015 | 2018-08-29 15:20:47 -0700 | [diff] [blame] | 29 | for hchart in \$(helm list -q | grep -E -v 'docker-registry|mavenrepo|ponnet'); |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 30 | do |
| 31 | echo "Purging chart: \${hchart}" |
| 32 | helm delete --purge "\${hchart}" |
| 33 | done |
Suchitra Vemuri | ddb2779 | 2018-08-23 15:29:42 -0700 | [diff] [blame] | 34 | """ |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 35 | timeout(5) { |
| 36 | waitUntil { |
| 37 | helm_deleted = sh returnStdout: true, script: """ |
| 38 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
Luca Prete | b496667 | 2018-08-29 16:49:48 -0700 | [diff] [blame] | 39 | helm ls -q | grep -E -v 'docker-registry|mavenrepo|ponnet' | wc -l |
Suchitra Vemuri | ddb2779 | 2018-08-23 15:29:42 -0700 | [diff] [blame] | 40 | """ |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 41 | return helm_deleted.toInteger() == 0 |
| 42 | } |
| 43 | } |
| 44 | timeout(5) { |
| 45 | waitUntil { |
| 46 | kubectl_deleted = sh returnStdout: true, script: """ |
| 47 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
Luca Prete | b496667 | 2018-08-29 16:49:48 -0700 | [diff] [blame] | 48 | kubectl get pods --all-namespaces --no-headers | grep -E -v 'kube-system|docker-registry|mavenrepo|ponnet' | wc -l |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 49 | """ |
| 50 | return kubectl_deleted.toInteger() == 0 |
Suchitra Vemuri | ddb2779 | 2018-08-23 15:29:42 -0700 | [diff] [blame] | 51 | } |
| 52 | } |
Luca Prete | 79fbc60 | 2018-09-24 15:33:31 -0700 | [diff] [blame] | 53 | // timeout(5) { |
| 54 | // waitUntil { |
| 55 | // kubectl_deleted = sh returnStdout: true, script: """ |
| 56 | // export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 57 | // kubectl get statefulset --all-namespaces --no-headers | grep -E -v 'kube-system|docker-registry|mavenrepo|ponnet' | wc -l |
| 58 | // """ |
| 59 | // return kubectl_deleted.toInteger() == 0 |
| 60 | // } |
| 61 | // } |
Suchitra Vemuri | ddb2779 | 2018-08-23 15:29:42 -0700 | [diff] [blame] | 62 | } |
| 63 | } |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 64 | dir ("helm-charts") { |
Kailash Khalasi | 100cf46 | 2018-09-20 10:24:57 -0700 | [diff] [blame] | 65 | stage('Install CORD Kafka') { |
| 66 | timeout(10) { |
| 67 | sh returnStdout: true, script: """ |
| 68 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 69 | helm install -f examples/kafka-single.yaml --version 0.8.8 -n cord-kafka incubator/kafka |
| 70 | """ |
| 71 | } |
| 72 | timeout(10) { |
| 73 | waitUntil { |
| 74 | kafka_instances_running = sh returnStdout: true, script: """ |
| 75 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 76 | kubectl get pods | grep cord-kafka | grep -i running | grep 1/1 | wc -l |
| 77 | """ |
| 78 | return kafka_instances_running.toInteger() == 2 |
| 79 | } |
| 80 | } |
| 81 | } |
Kailash | b065ba8 | 2018-11-05 10:17:31 -0800 | [diff] [blame] | 82 | stage('Install Logging Infrastructure') { |
| 83 | timeout(10) { |
| 84 | sh returnStdout: true, script: """ |
| 85 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 86 | helm dep update logging |
| 87 | helm install -f examples/logging-single.yaml -n logging logging |
| 88 | scripts/wait_for_pods.sh |
| 89 | """ |
| 90 | } |
| 91 | } |
Kailash Khalasi | 100cf46 | 2018-09-20 10:24:57 -0700 | [diff] [blame] | 92 | stage('Install Monitoring Infrastructure') { |
| 93 | timeout(10) { |
| 94 | sh returnStdout: true, script: """ |
| 95 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 96 | helm dep update nem-monitoring |
| 97 | helm install -n nem-monitoring nem-monitoring |
| 98 | scripts/wait_for_pods.sh |
| 99 | """ |
| 100 | } |
| 101 | } |
Kailash | 9b51318 | 2018-11-16 09:36:20 -0800 | [diff] [blame] | 102 | stage('Install etcd-cluster') { |
| 103 | timeout(10) { |
| 104 | sh returnStdout: true, script: """ |
| 105 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 106 | helm install -f ../${configBaseDir}/${configKubernetesDir}/${configFileName}.yml --version 0.8.0 -n etcd-operator stable/etcd-operator |
| 107 | """ |
| 108 | } |
| 109 | timeout(10) { |
| 110 | waitUntil { |
| 111 | etcd_running = sh returnStdout: true, script: """ |
| 112 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 113 | kubectl get pods | grep etcd | grep -i running | grep 1/1 | wc -l |
| 114 | """ |
Kailash | 4da7016 | 2018-11-16 12:58:33 -0800 | [diff] [blame] | 115 | return etcd_running.toInteger() == 3 |
Kailash | 9b51318 | 2018-11-16 09:36:20 -0800 | [diff] [blame] | 116 | } |
| 117 | } |
| 118 | } |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 119 | stage('Install voltha') { |
| 120 | timeout(10) { |
| 121 | sh returnStdout: true, script: """ |
| 122 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 123 | helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/ |
| 124 | helm dep build voltha |
Kailash | 9b51318 | 2018-11-16 09:36:20 -0800 | [diff] [blame] | 125 | helm install -n voltha -f ../${configBaseDir}/${configKubernetesDir}/${configFileName}.yml voltha |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 126 | """ |
| 127 | } |
| 128 | timeout(10) { |
| 129 | waitUntil { |
| 130 | voltha_completed = sh returnStdout: true, script: """ |
| 131 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 132 | kubectl get pods -n voltha | grep -i running | grep 1/1 | wc -l |
| 133 | """ |
| 134 | return voltha_completed.toInteger() == 8 |
| 135 | } |
| 136 | } |
| 137 | } |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 138 | stage('Install ONOS') { |
| 139 | timeout(10) { |
| 140 | sh returnStdout: true, script: """ |
| 141 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Luca Prete | 6ba2d9c | 2018-12-12 15:54:26 -0800 | [diff] [blame] | 142 | helm install -n onos -f ../${configBaseDir}/${configKubernetesDir}/${configFileName}.yml onos |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 143 | """ |
| 144 | } |
| 145 | timeout(10) { |
| 146 | waitUntil { |
| 147 | onos_completed = sh returnStdout: true, script: """ |
| 148 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
You Wang | 41ca537 | 2018-10-19 13:36:12 -0700 | [diff] [blame] | 149 | kubectl get pods | grep -i onos | grep -i running | grep 2/2 | wc -l |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 150 | """ |
| 151 | return onos_completed.toInteger() == 1 |
| 152 | } |
| 153 | } |
| 154 | } |
| 155 | stage('Install xos-core') { |
| 156 | timeout(10) { |
| 157 | sh returnStdout: true, script: """ |
| 158 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 159 | helm dep update xos-core |
| 160 | helm install -f ../${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n xos-core xos-core |
| 161 | """ |
| 162 | } |
| 163 | timeout(10) { |
| 164 | waitUntil { |
| 165 | xos_core_completed = sh returnStdout: true, script: """ |
| 166 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 167 | kubectl get pods | grep -i xos | grep -i running | grep 1/1 | wc -l |
| 168 | """ |
Scott Baker | de6374f | 2018-09-24 11:34:55 -0700 | [diff] [blame] | 169 | return xos_core_completed.toInteger() == 6 |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 170 | } |
| 171 | } |
| 172 | } |
Matteo Scandolo | 2f8271f | 2018-12-12 15:54:54 -0800 | [diff] [blame] | 173 | stage('Install seba-services profile') { |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 174 | timeout(10) { |
| 175 | sh returnStdout: true, script: """ |
| 176 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Matteo Scandolo | 2f8271f | 2018-12-12 15:54:54 -0800 | [diff] [blame] | 177 | helm dep update xos-profiles/seba-services |
| 178 | helm install -f ../${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n seba-services xos-profiles/seba-services |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 179 | """ |
| 180 | } |
| 181 | timeout(10) { |
| 182 | waitUntil { |
| 183 | att_workflow_tosca_completed = sh returnStdout: true, script: """ |
| 184 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
Matteo Scandolo | 2f8271f | 2018-12-12 15:54:54 -0800 | [diff] [blame] | 185 | kubectl get pods | grep -i seba-services-tosca-loader | grep -i completed | wc -l |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 186 | """ |
| 187 | return att_workflow_tosca_completed.toInteger() == 1 |
| 188 | } |
| 189 | } |
| 190 | } |
| 191 | stage('Install base-kubernetes') { |
| 192 | timeout(10) { |
| 193 | sh returnStdout: true, script: """ |
| 194 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 195 | helm dep update xos-profiles/base-kubernetes |
| 196 | helm install -f ../${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n base-kubernetes xos-profiles/base-kubernetes |
| 197 | """ |
| 198 | } |
| 199 | timeout(10) { |
| 200 | waitUntil { |
| 201 | base_kubernetes_tosca_running = sh returnStdout: true, script: """ |
| 202 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 203 | kubectl get pods | grep -i base-kubernetes-tosca-loader | grep -i completed | wc -l |
| 204 | """ |
| 205 | return base_kubernetes_tosca_running.toInteger() == 1 |
| 206 | } |
Suchitra Vemuri | ddb2779 | 2018-08-23 15:29:42 -0700 | [diff] [blame] | 207 | } |
| 208 | } |
Matteo Scandolo | 2f8271f | 2018-12-12 15:54:54 -0800 | [diff] [blame] | 209 | stage('Install att workflow') { |
| 210 | timeout(10) { |
| 211 | sh returnStdout: true, script: """ |
| 212 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 213 | helm dep update workflows/att-workflow |
Luca Prete | 45c393b | 2018-12-18 12:18:14 -0800 | [diff] [blame] | 214 | helm install -f ../${configBaseDir}/${configKubernetesDir}/${configFileName}.yml --set att-workflow-driver.kafkaService=cord-kafka -n att-workflow workflows/att-workflow |
Matteo Scandolo | 2f8271f | 2018-12-12 15:54:54 -0800 | [diff] [blame] | 215 | """ |
| 216 | } |
| 217 | timeout(10) { |
| 218 | waitUntil { |
| 219 | att_workflow_tosca_completed = sh returnStdout: true, script: """ |
| 220 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 221 | kubectl get pods | grep -i att-workflow-tosca-loader | grep -i completed | wc -l |
| 222 | """ |
| 223 | return att_workflow_tosca_completed.toInteger() == 1 |
| 224 | } |
| 225 | } |
| 226 | } |
Suchitra Vemuri | ddb2779 | 2018-08-23 15:29:42 -0700 | [diff] [blame] | 227 | } |
Kailash | 9b56c86 | 2018-11-29 08:45:25 -0800 | [diff] [blame] | 228 | if ( params.reinstallOlt ) { |
| 229 | stage('Reinstall OLT software') { |
| 230 | for(int i=0; i < deployment_config.olts.size(); i++) { |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 231 | sh returnStdout: true, script: """ |
Kailash | 9b56c86 | 2018-11-29 08:45:25 -0800 | [diff] [blame] | 232 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'dpkg --remove asfvolt16 && dpkg --purge asfvolt16' |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 233 | """ |
Kailash | 9b56c86 | 2018-11-29 08:45:25 -0800 | [diff] [blame] | 234 | timeout(5) { |
| 235 | waitUntil { |
| 236 | olt_sw_present = sh returnStdout: true, script: """ |
| 237 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'dpkg --list | grep asfvolt16 | wc -l' |
| 238 | """ |
| 239 | return olt_sw_present.toInteger() == 0 |
| 240 | } |
| 241 | } |
| 242 | sh returnStdout: true, script: """ |
| 243 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} "dpkg --install ${oltDebVersion}" |
| 244 | """ |
| 245 | timeout(5) { |
| 246 | waitUntil { |
| 247 | olt_sw_present = sh returnStdout: true, script: """ |
| 248 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'dpkg --list | grep asfvolt16 | wc -l' |
| 249 | """ |
| 250 | return olt_sw_present.toInteger() == 1 |
| 251 | } |
| 252 | } |
| 253 | // If the OLT is connected to a 40G switch interface, set the NNI port to be downgraded |
| 254 | if ("${deployment_config.olts[i].fortygig}" != null && "${deployment_config.olts[i].fortygig}" == 'true') { |
| 255 | sh returnStdout: true, script: """ |
| 256 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'echo "port ce128 sp=40000" >> /broadcom/qax.soc' |
| 257 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} '/opt/bcm68620/svk_init.sh' |
| 258 | """ |
| 259 | } |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 260 | } |
| 261 | } |
Kailash | 9b56c86 | 2018-11-29 08:45:25 -0800 | [diff] [blame] | 262 | stage('Restart OLT processes') { |
| 263 | for(int i=0; i < deployment_config.olts.size(); i++) { |
| 264 | timeout(5) { |
| 265 | sh returnStdout: true, script: """ |
| 266 | ssh-keyscan -H ${deployment_config.olts[i].ip} >> ~/.ssh/known_hosts |
| 267 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'service bal_core_dist stop' || true |
| 268 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'service openolt stop' || true |
| 269 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} '> /var/log/bal_core_dist.log' |
| 270 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} '> /var/log/openolt.log' |
| 271 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'service bal_core_dist start &' |
| 272 | sleep 5 |
| 273 | sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'service openolt start &' |
| 274 | """ |
| 275 | } |
| 276 | timeout(15) { |
| 277 | waitUntil { |
| 278 | onu_discovered = sh returnStdout: true, script: "sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'cat /var/log/openolt.log | grep \"oper_state: up\" | wc -l'" |
| 279 | return onu_discovered.toInteger() > 0 |
| 280 | } |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 281 | } |
| 282 | } |
| 283 | } |
| 284 | } |
Kailash Khalasi | 4d18e20 | 2018-09-14 13:32:16 -0700 | [diff] [blame] | 285 | if ( params.configurePod ) { |
Kailash Khalasi | def2f4e | 2018-09-17 10:39:14 -0700 | [diff] [blame] | 286 | dir ("${configBaseDir}/${configToscaDir}/att-workflow") { |
Kailash Khalasi | 4d18e20 | 2018-09-14 13:32:16 -0700 | [diff] [blame] | 287 | stage('Configure R-CORD - Fabric and whitelist') { |
| 288 | timeout(1) { |
| 289 | waitUntil { |
| 290 | out_fabric = sh returnStdout: true, script: """ |
| 291 | curl -s -H "xos-username:admin@opencord.org" -H "xos-password:letmein" -X POST --data-binary @${configFileName}-fabric.yaml http://${deployment_config.nodes[0].ip}:30007/run | grep -i "created models" | wc -l |
| 292 | """ |
| 293 | return out_fabric.toInteger() == 1 |
| 294 | } |
Kailash Khalasi | c1a90f1 | 2018-09-13 13:13:22 -0700 | [diff] [blame] | 295 | } |
| 296 | } |
Kailash Khalasi | 4d18e20 | 2018-09-14 13:32:16 -0700 | [diff] [blame] | 297 | stage('Configure R-CORD - Subscriber') { |
| 298 | timeout(1) { |
| 299 | waitUntil { |
| 300 | out_subscriber = sh returnStdout: true, script: """ |
| 301 | curl -s -H 'xos-username:admin@opencord.org' -H 'xos-password:letmein' -X POST --data-binary @${configFileName}-subscriber.yaml http://${deployment_config.nodes[0].ip}:30007/run | grep -i "created models" | wc -l |
| 302 | """ |
| 303 | return out_subscriber.toInteger() == 1 |
| 304 | } |
Kailash Khalasi | c1a90f1 | 2018-09-13 13:13:22 -0700 | [diff] [blame] | 305 | } |
| 306 | } |
Kailash Khalasi | 4d18e20 | 2018-09-14 13:32:16 -0700 | [diff] [blame] | 307 | stage('Configure R-CORD - OLT') { |
| 308 | timeout(1) { |
| 309 | waitUntil { |
| 310 | out_olt = sh returnStdout: true, script: """ |
| 311 | curl -H 'xos-username:admin@opencord.org' -H 'xos-password:letmein' -X POST --data-binary @${configFileName}-olt.yaml http://${deployment_config.nodes[0].ip}:30007/run | grep -i "created models" | wc -l |
| 312 | """ |
| 313 | return out_olt.toInteger() == 1 |
| 314 | } |
Kailash Khalasi | c1a90f1 | 2018-09-13 13:13:22 -0700 | [diff] [blame] | 315 | } |
| 316 | } |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 317 | } |
Suchitra Vemuri | ddb2779 | 2018-08-23 15:29:42 -0700 | [diff] [blame] | 318 | } |
Matteo Scandolo | 8819edd | 2018-11-27 13:18:08 -0800 | [diff] [blame] | 319 | if ( params.installBBSim ) { |
| 320 | dir ("helm-charts") { |
| 321 | stage('Install BBSim') { |
| 322 | timeout(10) { |
| 323 | sh returnStdout: true, script: """ |
| 324 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 325 | helm install -f ../${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n bbsim bbsim --set onus_per_pon_port=${onuNumber} |
| 326 | """ |
| 327 | } |
| 328 | timeout(10) { |
| 329 | waitUntil { |
| 330 | base_kubernetes_tosca_running = sh returnStdout: true, script: """ |
| 331 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 332 | kubectl get pods -n voltha | grep -i bbsim | wc -l |
| 333 | """ |
| 334 | return base_kubernetes_tosca_running.toInteger() == 1 |
| 335 | } |
| 336 | } |
| 337 | } |
| 338 | } |
| 339 | dir ("${configBaseDir}/${configToscaDir}/bbsim") { |
| 340 | stage('Configure BBSim - OLT') { |
| 341 | timeout(1) { |
| 342 | waitUntil { |
| 343 | out_olt = sh returnStdout: true, script: """ |
| 344 | curl -H 'xos-username:admin@opencord.org' -H 'xos-password:letmein' -X POST --data-binary @bbsim-16.yaml http://${deployment_config.nodes[0].ip}:30007/run | grep -i "created models" | wc -l |
| 345 | """ |
| 346 | return out_olt.toInteger() == 1 |
| 347 | } |
| 348 | } |
| 349 | } |
| 350 | } |
| 351 | } |
Luca Prete | b3029bd | 2018-08-28 16:31:39 -0700 | [diff] [blame] | 352 | currentBuild.result = 'SUCCESS' |
| 353 | } catch (err) { |
| 354 | currentBuild.result = 'FAILURE' |
| 355 | step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false]) |
| 356 | } |
| 357 | echo "RESULT: ${currentBuild.result}" |
Suchitra Vemuri | ddb2779 | 2018-08-23 15:29:42 -0700 | [diff] [blame] | 358 | } |
| 359 | } |