Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [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 | |
| 15 | node ("${TestNodeName}") { |
| 16 | timeout (100) { |
| 17 | try { |
| 18 | stage ("Parse deployment configuration file") { |
Matteo Scandolo | 9f8056b | 2019-01-17 10:33:51 -0800 | [diff] [blame] | 19 | sh returnStdout: true, script: "rm -rf helm-charts helm-repo-tools ${configBaseDir}" |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 20 | sh returnStdout: true, script: "git clone -b ${branch} ${cordRepoUrl}/helm-repo-tools" |
Wei-Yu Chen | 992665b | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 21 | sh returnStdout: true, script: "git clone -b ${branch} ${cordRepoUrl}/helm-charts" |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 22 | sh returnStdout: true, script: "git clone -b ${branch} ${cordRepoUrl}/${configBaseDir}" |
| 23 | deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}.yaml" |
| 24 | } |
| 25 | stage('Clean up') { |
| 26 | timeout(10) { |
| 27 | sh returnStdout: true, script: """ |
| 28 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 29 | for hchart in \$(helm list -q | grep -E -v 'docker-registry|mavenrepo|ponnet'); |
| 30 | do |
| 31 | echo "Purging chart: \${hchart}" |
| 32 | helm delete --purge "\${hchart}" |
| 33 | done |
| 34 | """ |
| 35 | timeout(5) { |
| 36 | waitUntil { |
| 37 | helm_deleted = sh returnStdout: true, script: """ |
| 38 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 39 | helm ls -q | grep -E -v 'docker-registry|mavenrepo|ponnet' | wc -l |
| 40 | """ |
| 41 | return helm_deleted.toInteger() == 0 |
| 42 | } |
| 43 | } |
Wei-Yu Chen | 9de5f16 | 2019-01-17 10:40:38 -0800 | [diff] [blame] | 44 | timeout(5) { |
Wei-Yu Chen | 213821c | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 45 | dir ("helm-charts") { |
| 46 | stage("Cleanup SR-IOV CNI and SR-IOV Network Device Plugin") { |
| 47 | sh returnStdout: true, script: """ |
| 48 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Matteo Scandolo | 736f6b8 | 2019-01-24 15:29:07 -0800 | [diff] [blame] | 49 | kubectl delete -f mcord/cni-config/05-sriov-device-plugin.yaml || true |
| 50 | kubectl delete -f mcord/cni-config/04-sriov-device-plugin-configmap.yaml || true |
| 51 | kubectl delete -f mcord/cni-config/03-network-definition.yaml || true |
| 52 | kubectl delete -f mcord/cni-config/02-network-crd.yaml || true |
| 53 | kubectl delete -f mcord/cni-config/01-cni-service-account.yaml || true |
Wei-Yu Chen | 213821c | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 54 | """ |
| 55 | } |
| 56 | } |
| 57 | } |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 58 | timeout(5) { |
| 59 | waitUntil { |
| 60 | kubectl_deleted = sh returnStdout: true, script: """ |
| 61 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
Matteo Scandolo | 736f6b8 | 2019-01-24 15:29:07 -0800 | [diff] [blame] | 62 | kubectl get pods --all-namespaces --no-headers | grep -E -v 'kube-system|docker-registry|mavenrepo|ponnet|test' | wc -l |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 63 | """ |
| 64 | return kubectl_deleted.toInteger() == 0 |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | } |
Luca Prete | 62a48c8 | 2019-01-16 10:40:01 -0800 | [diff] [blame] | 69 | stage('Add Helm repositories') { |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 70 | sh returnStdout: true, script: """ |
| 71 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Wei-Yu Chen | 76dd793 | 2019-01-18 14:14:23 -0800 | [diff] [blame] | 72 | helm init --upgrade --force-upgrade |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 73 | helm repo add cord https://charts.opencord.org |
Luca Prete | 62a48c8 | 2019-01-16 10:40:01 -0800 | [diff] [blame] | 74 | helm repo add incubator http://storage.googleapis.com/kubernetes-charts-incubator |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 75 | helm repo update |
| 76 | """ |
| 77 | timeout(1) { |
| 78 | waitUntil { |
Wei-Yu Chen | 76dd793 | 2019-01-18 14:14:23 -0800 | [diff] [blame] | 79 | tillerpod_running = sh returnStdout: true, script: """ |
| 80 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 81 | kubectl -n kube-system get pods | grep tiller-deploy | grep Running | wc -l |
| 82 | """ |
| 83 | return tillerpod_running.toInteger() == 1 |
| 84 | } |
| 85 | } |
| 86 | timeout(1) { |
| 87 | waitUntil { |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 88 | cord_repo_present = sh returnStdout: true, script: """ |
| 89 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 90 | helm repo list | grep cord | wc -l |
| 91 | """ |
| 92 | return cord_repo_present.toInteger() == 1 |
| 93 | } |
| 94 | } |
| 95 | } |
Matteo Scandolo | 08aea47 | 2019-01-23 11:45:37 -0800 | [diff] [blame] | 96 | |
| 97 | stage('Install etcd-cluster') { |
| 98 | timeout(10) { |
| 99 | sh returnStdout: true, script: """ |
| 100 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 101 | helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml --version 0.8.3 -n etcd-operator stable/etcd-operator |
Wei-Yu Chen | 396d24e | 2019-01-28 11:48:52 -0800 | [diff] [blame] | 102 | helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml --set etcdNodePort=32379 -n etcd cord/etcd-cluster |
Matteo Scandolo | 08aea47 | 2019-01-23 11:45:37 -0800 | [diff] [blame] | 103 | """ |
| 104 | } |
| 105 | timeout(10) { |
| 106 | waitUntil { |
| 107 | etcd_running = sh returnStdout: true, script: """ |
| 108 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 109 | kubectl get pods | grep etcd | grep -i running | grep 1/1 | wc -l |
| 110 | """ |
| 111 | return etcd_running.toInteger() == 6 |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | |
Wei-Yu Chen | 992665b | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 116 | dir ("helm-charts") { |
| 117 | stage('Install SR-IOV CNI and SR-IOV Network Device Plugin') { |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 118 | sh returnStdout: true, script: """ |
| 119 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Wei-Yu Chen | 992665b | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 120 | kubectl apply -f mcord/cni-config/02-network-crd.yaml |
| 121 | kubectl apply -f mcord/cni-config/ |
Wei-Yu Chen | 7f8c4dd | 2019-01-17 15:32:03 -0800 | [diff] [blame] | 122 | sleep 5 |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 123 | """ |
| 124 | } |
| 125 | } |
Wei-Yu Chen | 992665b | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 126 | |
Wei-Yu Chen | 037762d | 2019-01-24 11:12:39 -0800 | [diff] [blame] | 127 | // In current development progress, we prefered to keep this for testing eNodeB's functionality |
Matteo Scandolo | ef6e402 | 2019-01-25 14:40:10 -0800 | [diff] [blame] | 128 | if ( params.installEpcControlPlane ) { |
| 129 | stage("Install M-CORD Control Plane Services") { |
| 130 | sh returnStdout: true, script: """ |
| 131 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 132 | helm install -n mcord-control-plane --namespace epc -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml cord/mcord-control-plane |
| 133 | """ |
| 134 | } |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 135 | } |
Wei-Yu Chen | 992665b | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 136 | |
| 137 | stage("Install M-CORD Data Plane Services") { |
| 138 | sh returnStdout: true, script: """ |
| 139 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Wei-Yu Chen | 7f8c4dd | 2019-01-17 15:32:03 -0800 | [diff] [blame] | 140 | helm install -n mcord-data-plane --namespace epc -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml cord/mcord-data-plane |
Wei-Yu Chen | 992665b | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 141 | """ |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 142 | } |
Wei-Yu Chen | 992665b | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 143 | |
Matteo Scandolo | 202064f | 2019-01-24 15:01:39 -0800 | [diff] [blame] | 144 | stage('Install CORD Kafka') { |
| 145 | timeout(10) { |
| 146 | sh returnStdout: true, script: """ |
| 147 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 148 | 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 |
| 149 | """ |
| 150 | } |
| 151 | timeout(10) { |
| 152 | waitUntil { |
| 153 | kafka_instances_running = sh returnStdout: true, script: """ |
| 154 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 155 | kubectl get pods | grep cord-kafka | grep -i running | grep 1/1 | wc -l |
| 156 | """ |
| 157 | return kafka_instances_running.toInteger() == 2 |
| 158 | } |
| 159 | } |
| 160 | } |
Wei-Yu Chen | 992665b | 2019-01-17 10:21:32 -0800 | [diff] [blame] | 161 | // stage('Install Logging Infrastructure') { |
| 162 | // timeout(10) { |
| 163 | // sh returnStdout: true, script: """ |
| 164 | // export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 165 | // 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 |
| 166 | // helm-repo-tools/wait_for_pods.sh |
| 167 | // """ |
| 168 | // } |
| 169 | // } |
| 170 | // stage('Install Monitoring Infrastructure') { |
| 171 | // timeout(10) { |
| 172 | // sh returnStdout: true, script: """ |
| 173 | // export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 174 | // helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n nem-monitoring cord/nem-monitoring |
| 175 | // helm-repo-tools/wait_for_pods.sh |
| 176 | // """ |
| 177 | // } |
| 178 | // } |
Matteo Scandolo | 202064f | 2019-01-24 15:01:39 -0800 | [diff] [blame] | 179 | stage('Install ONOS') { |
| 180 | timeout(10) { |
| 181 | sh returnStdout: true, script: """ |
| 182 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Matteo Scandolo | 6c637ce | 2019-01-31 14:58:38 -0800 | [diff] [blame] | 183 | helm install -n onos -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml cord/onos --version 1.1.0 |
Matteo Scandolo | 202064f | 2019-01-24 15:01:39 -0800 | [diff] [blame] | 184 | """ |
| 185 | } |
| 186 | timeout(10) { |
| 187 | waitUntil { |
| 188 | onos_completed = sh returnStdout: true, script: """ |
| 189 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 190 | kubectl get pods | grep -i onos | grep -i running | grep 2/2 | wc -l |
| 191 | """ |
| 192 | return onos_completed.toInteger() == 1 |
| 193 | } |
| 194 | } |
| 195 | } |
| 196 | stage('Install xos-core') { |
| 197 | timeout(10) { |
| 198 | sh returnStdout: true, script: """ |
| 199 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Matteo Scandolo | 6c637ce | 2019-01-31 14:58:38 -0800 | [diff] [blame] | 200 | helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n xos-core cord/xos-core --version 2.3.3 |
Matteo Scandolo | 202064f | 2019-01-24 15:01:39 -0800 | [diff] [blame] | 201 | """ |
| 202 | } |
| 203 | timeout(10) { |
| 204 | waitUntil { |
| 205 | xos_core_completed = sh returnStdout: true, script: """ |
| 206 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 207 | kubectl get pods | grep -i xos | grep -i running | grep 1/1 | wc -l |
| 208 | """ |
| 209 | return xos_core_completed.toInteger() == 6 |
| 210 | } |
| 211 | } |
| 212 | } |
| 213 | stage('Install M-CORD Profile') { |
| 214 | timeout(10) { |
| 215 | sh returnStdout: true, script: """ |
| 216 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 217 | helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n mcord cord/mcord |
| 218 | """ |
| 219 | } |
| 220 | timeout(10) { |
| 221 | waitUntil { |
| 222 | tosca_completed = sh returnStdout: true, script: """ |
| 223 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 224 | kubectl get pods | grep -i mcord-tosca-loader | grep -i completed | wc -l |
| 225 | """ |
| 226 | return tosca_completed.toInteger() == 1 |
| 227 | } |
| 228 | } |
| 229 | } |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 230 | |
Matteo Scandolo | ef6e402 | 2019-01-25 14:40:10 -0800 | [diff] [blame] | 231 | // SEBA Begin |
| 232 | stage('Install SEBA Profile') { |
| 233 | timeout(10) { |
| 234 | sh returnStdout: true, script: """ |
| 235 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Matteo Scandolo | 6c637ce | 2019-01-31 14:58:38 -0800 | [diff] [blame] | 236 | helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n seba cord/seba-services --set fabric.enabled=false --set onos-service.enabled=false --version 1.0.5 |
Matteo Scandolo | ef6e402 | 2019-01-25 14:40:10 -0800 | [diff] [blame] | 237 | """ |
| 238 | } |
| 239 | timeout(10) { |
| 240 | waitUntil { |
| 241 | tosca_completed = sh returnStdout: true, script: """ |
| 242 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 243 | kubectl get pods | grep -i seba-services-tosca-loader | grep -i completed | wc -l |
| 244 | """ |
| 245 | return tosca_completed.toInteger() == 1 |
| 246 | } |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | stage('Install base-kubernetes') { |
| 251 | timeout(10) { |
| 252 | sh returnStdout: true, script: """ |
| 253 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Matteo Scandolo | 6c637ce | 2019-01-31 14:58:38 -0800 | [diff] [blame] | 254 | helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n base-kubernetes cord/base-kubernetes --version 1.0.2 |
Matteo Scandolo | ef6e402 | 2019-01-25 14:40:10 -0800 | [diff] [blame] | 255 | """ |
| 256 | } |
| 257 | timeout(10) { |
| 258 | waitUntil { |
| 259 | base_kubernetes_tosca_running = sh returnStdout: true, script: """ |
| 260 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 261 | kubectl get pods | grep -i base-kubernetes-tosca-loader | grep -i completed | wc -l |
| 262 | """ |
| 263 | return base_kubernetes_tosca_running.toInteger() == 1 |
| 264 | } |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | stage('Install att workflow') { |
| 269 | timeout(10) { |
| 270 | sh returnStdout: true, script: """ |
| 271 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 272 | helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml --set att-workflow-driver.kafkaService=cord-kafka -n att-workflow --version 1.0.2 cord/att-workflow |
| 273 | """ |
| 274 | } |
| 275 | timeout(10) { |
| 276 | waitUntil { |
| 277 | att_workflow_tosca_completed = sh returnStdout: true, script: """ |
| 278 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 279 | kubectl get pods | grep -i att-workflow-tosca-loader | grep -i completed | wc -l |
| 280 | """ |
| 281 | return att_workflow_tosca_completed.toInteger() == 1 |
| 282 | } |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | stage('Install voltha') { |
| 287 | timeout(10) { |
| 288 | sh returnStdout: true, script: """ |
| 289 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
Matteo Scandolo | 6c637ce | 2019-01-31 14:58:38 -0800 | [diff] [blame] | 290 | helm install -n voltha -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml cord/voltha --set etcd.cluster.enabled=false --version 1.0.3 |
Matteo Scandolo | ef6e402 | 2019-01-25 14:40:10 -0800 | [diff] [blame] | 291 | """ |
| 292 | } |
| 293 | timeout(10) { |
| 294 | waitUntil { |
| 295 | voltha_completed = sh returnStdout: true, script: """ |
| 296 | export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| 297 | kubectl get pods -n voltha | grep -i running | grep 1/1 | wc -l |
| 298 | """ |
| 299 | return voltha_completed.toInteger() == 8 |
| 300 | } |
| 301 | } |
| 302 | } |
| 303 | // SEBA end |
| 304 | |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 305 | if ( params.configurePod ) { |
Matteo Scandolo | 202064f | 2019-01-24 15:01:39 -0800 | [diff] [blame] | 306 | dir ("${configBaseDir}/${configToscaDir}/mcord") { |
| 307 | stage('Configure MCORD - Fabric') { |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 308 | timeout(1) { |
| 309 | waitUntil { |
| 310 | out_fabric = sh returnStdout: true, script: """ |
| 311 | 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 |
| 312 | """ |
| 313 | return out_fabric.toInteger() == 1 |
| 314 | } |
| 315 | } |
| 316 | } |
Matteo Scandolo | ef6e402 | 2019-01-25 14:40:10 -0800 | [diff] [blame] | 317 | } |
| 318 | dir ("${configBaseDir}/${configToscaDir}/att-workflow") { |
| 319 | stage('Configure SEBA - Fabric and whitelist') { |
| 320 | timeout(1) { |
| 321 | waitUntil { |
| 322 | out_fabric = sh returnStdout: true, script: """ |
| 323 | 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 |
| 324 | """ |
| 325 | return out_fabric.toInteger() == 1 |
| 326 | } |
| 327 | } |
| 328 | } |
| 329 | stage('Configure SEBA - Subscriber') { |
| 330 | timeout(1) { |
| 331 | waitUntil { |
| 332 | out_subscriber = sh returnStdout: true, script: """ |
| 333 | 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 |
| 334 | """ |
| 335 | return out_subscriber.toInteger() == 1 |
| 336 | } |
| 337 | } |
| 338 | } |
| 339 | stage('Configure SEBA - OLT') { |
| 340 | timeout(1) { |
| 341 | waitUntil { |
| 342 | out_olt = sh returnStdout: true, script: """ |
| 343 | 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 |
| 344 | """ |
| 345 | return out_olt.toInteger() == 1 |
| 346 | } |
| 347 | } |
| 348 | } |
Luca Prete | 45401c8 | 2019-01-15 15:31:22 -0800 | [diff] [blame] | 349 | } |
| 350 | } |
| 351 | currentBuild.result = 'SUCCESS' |
| 352 | } catch (err) { |
| 353 | currentBuild.result = 'FAILURE' |
| 354 | step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false]) |
| 355 | } |
| 356 | echo "RESULT: ${currentBuild.result}" |
| 357 | } |
| 358 | } |