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