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