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