| // Copyright 2017-present Open Networking Foundation |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| node ("${TestNodeName}") { |
| timeout (100) { |
| try { |
| stage ("Parse deployment configuration file") { |
| sh returnStdout: true, script: "rm -rf helm-charts helm-repo-tools ${configBaseDir}" |
| sh returnStdout: true, script: "git clone -b ${branch} ${cordRepoUrl}/helm-repo-tools" |
| sh returnStdout: true, script: "git clone -b ${branch} ${cordRepoUrl}/helm-charts" |
| sh returnStdout: true, script: "git clone -b ${branch} ${cordRepoUrl}/${configBaseDir}" |
| deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}.yaml" |
| } |
| stage('Clean up') { |
| timeout(10) { |
| sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| for hchart in \$(helm list -q | grep -E -v 'docker-registry|mavenrepo|ponnet'); |
| do |
| echo "Purging chart: \${hchart}" |
| helm delete --purge "\${hchart}" |
| done |
| """ |
| timeout(5) { |
| waitUntil { |
| helm_deleted = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| helm ls -q | grep -E -v 'docker-registry|mavenrepo|ponnet' | wc -l |
| """ |
| return helm_deleted.toInteger() == 0 |
| } |
| } |
| |
| // In Multi-cluster scenario, we only need to install SR-IOV on data plane cluster |
| // if ( ! params.installEpcControlPlane ) { |
| // timeout(5) { |
| // dir ("helm-charts") { |
| // stage("Cleanup SR-IOV Network Device Plugin Daemonset") { |
| // sh returnStdout: true, script: """ |
| // export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| // kubectl delete -f mcord/cni-config/05-sriov-device-plugin.yaml || true |
| // kubectl delete -f mcord/cni-config/04-sriov-device-plugin-configmap.yaml || true |
| // kubectl delete -f mcord/cni-config/03-network-definition.yaml || true |
| // kubectl delete -f mcord/cni-config/02-network-crd.yaml || true |
| // kubectl delete -f mcord/cni-config/01-cni-service-account.yaml || true |
| // """ |
| // } |
| // } |
| // } |
| // } |
| |
| timeout(5) { |
| waitUntil { |
| kubectl_deleted = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| kubectl get pods --all-namespaces --no-headers | grep -E -v 'kube-system|docker-registry|mavenrepo|ponnet|test' | wc -l |
| """ |
| return kubectl_deleted.toInteger() == 0 |
| } |
| } |
| } |
| } |
| |
| // OLT Software START |
| if ( params.reinstallOlt ) { |
| stage('Reinstall OLT software') { |
| for(int i=0; i < deployment_config.olts.size(); i++) { |
| sh returnStdout: true, script: """ |
| 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' |
| """ |
| timeout(5) { |
| waitUntil { |
| olt_sw_present = sh returnStdout: true, script: """ |
| 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' |
| """ |
| return olt_sw_present.toInteger() == 0 |
| } |
| } |
| sh returnStdout: true, script: """ |
| sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} "dpkg --install ${oltDebVersion}" |
| """ |
| timeout(5) { |
| waitUntil { |
| olt_sw_present = sh returnStdout: true, script: """ |
| 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' |
| """ |
| return olt_sw_present.toInteger() == 1 |
| } |
| } |
| // If the OLT is connected to a 40G switch interface, set the NNI port to be downgraded |
| if ("${deployment_config.olts[i].fortygig}" != null && "${deployment_config.olts[i].fortygig}" == 'true') { |
| sh returnStdout: true, script: """ |
| 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' |
| sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} '/opt/bcm68620/svk_init.sh' |
| """ |
| } |
| } |
| } |
| |
| stage('Restart OLT processes') { |
| for(int i=0; i < deployment_config.olts.size(); i++) { |
| timeout(5) { |
| sh returnStdout: true, script: """ |
| ssh-keyscan -H ${deployment_config.olts[i].ip} >> ~/.ssh/known_hosts |
| 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 |
| sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'service openolt stop' || true |
| 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' |
| sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} '> /var/log/openolt.log' |
| sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'service bal_core_dist start &' |
| sleep 5 |
| sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'service openolt start &' |
| """ |
| } |
| timeout(15) { |
| waitUntil { |
| 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'" |
| return onu_discovered.toInteger() > 0 |
| } |
| } |
| } |
| } |
| } |
| |
| // Start to deploy etcd clusters and M-CORD Services |
| stage('Add Helm repositories') { |
| sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| helm init --upgrade --force-upgrade |
| helm repo add cord https://charts.opencord.org |
| helm repo add incubator http://storage.googleapis.com/kubernetes-charts-incubator |
| helm repo update |
| """ |
| timeout(1) { |
| waitUntil { |
| tillerpod_running = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| kubectl -n kube-system get pods | grep tiller-deploy | grep Running | wc -l |
| """ |
| return tillerpod_running.toInteger() == 1 |
| } |
| } |
| timeout(1) { |
| waitUntil { |
| cord_repo_present = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| helm repo list | grep cord | wc -l |
| """ |
| return cord_repo_present.toInteger() == 1 |
| } |
| } |
| } |
| stage('Install etcd-cluster') { |
| timeout(10) { |
| sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml --version 0.8.3 -n etcd-operator stable/etcd-operator |
| """ |
| } |
| timeout(10) { |
| waitUntil { |
| etcd_operator_running = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| kubectl get pods | grep etcd-operator | grep -i running | grep 1/1 | wc -l |
| """ |
| return etcd_operator_running.toInteger() == 3 |
| } |
| } |
| timeout(1) { |
| waitUntil { |
| etcd_operator_definition = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| kubectl get crd -o json | jq -r '.items[].spec | select(.group=="etcd.database.coreos.com").names.kind' | grep -E 'EtcdBackup|EtcdCluster|EtcdRestore' | wc -l |
| """ |
| return etcd_operator_definition.toInteger() == 3 |
| } |
| |
| } |
| timeout(10) { |
| sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml --set etcdNodePort=32379 --set clusterSize=1 -n etcd cord/etcd-cluster |
| """ |
| } |
| timeout(10) { |
| waitUntil { |
| etcd_cluster_running = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| kubectl get pods | grep etcd-cluster | grep -i running | grep 1/1 | wc -l |
| """ |
| return etcd_cluster_running.toInteger() == 1 |
| } |
| } |
| } |
| |
| dir ("helm-charts") { |
| stage('Install SR-IOV CNI and SR-IOV Network Device Plugin') { |
| sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| kubectl apply -f mcord/cni-config/02-network-crd.yaml |
| """ |
| |
| timeout(1) { |
| waitUntil { |
| network_crd_exist = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| kubectl get crd -o json | jq -r '.items[].spec | select(.group=="k8s.cni.cncf.io").names.kind' | grep -E 'NetworkAttachmentDefinition' | wc -l |
| """ |
| return network_crd_exist.toInteger() == 1 |
| } |
| } |
| |
| // sh returnStdout: true, script: """ |
| // export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| // kubectl apply -f mcord/cni-config/ |
| // """ |
| |
| // Because of SR-IOV daemonset will restart the kubelet and containerd, so we need to wait tiller up. |
| timeout(1) { |
| waitUntil { |
| tillerpod_running = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| kubectl -n kube-system get pods | grep tiller-deploy | grep Running | wc -l |
| """ |
| return tillerpod_running.toInteger() == 1 |
| } |
| } |
| |
| // Sometimes tillerpod is up, but it's not ready to accept deployment yet, let's wait. |
| timeout(1) { |
| waitUntil { |
| helm_client_working = sh returnStatus: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| helm ls |
| """ |
| return helm_client_working == 0 |
| } |
| } |
| } |
| } |
| |
| // Deploy Sequence: EPC Data plane > vBBU > EPC Control plane |
| stage("Install M-CORD Data Plane Services") { |
| mcord_dataplane_working = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| helm install -n mcord-data-plane --namespace epc -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml cord/mcord-data-plane |
| """ |
| |
| timeout (10) { |
| waitUntil { |
| mcord_dataplane_running = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| kubectl -n epc get pods | grep ngic-dp | grep -i running | grep 1/1 | wc -l |
| """ |
| return mcord_dataplane_running.toInteger() == 1 |
| } |
| } |
| } |
| |
| stage("Install M-CORD BBU Services") { |
| mcord_bbu_working = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| helm install -n mcord-bbu --namespace epc -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml cord/mcord-bbu |
| """ |
| |
| timeout (10) { |
| waitUntil { |
| mcord_bbu_running = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| kubectl -n epc get pods | grep accelleran | grep -i running | grep 3/3 | wc -l |
| """ |
| return mcord_bbu_running.toInteger() == 1 |
| } |
| } |
| } |
| |
| // if ( params.installEpcControlPlane ) { |
| // timeout(2) { |
| // waitUntil { |
| // mcord_bbu_running = sh returnStdout: true, script: """ |
| // export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| // kubectl -n epc get pods | grep accelleran | grep -i running | grep 3/3 | wc -l |
| // """ |
| // return mcord_bbu_running.toInteger() == 1 |
| // } |
| // } |
| // stage("Install M-CORD Control Plane Services") { |
| // mcord_controlplane_working = sh returnStdout: true, script: """ |
| // export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| // ngic_s1u_net_ip=\$(kubectl exec -n epc ngic-dp-0 ifconfig s1u-net | grep 'inet addr' | cut -d: -f2 | awk '{print \$1}') |
| // bbu_eth0=\$(kubectl -n epc get pods accelleran-0 --template={{.status.podIP}}) |
| // helm install -n mcord-control-plane --namespace epc -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml cord/mcord-control-plane --set accelleran_hostname=\$bbu_eth0 --set spgwu_s1u_ip=\$ngic_s1u_net_ip |
| // """ |
| // } |
| // } |
| |
| stage("Install CDN Local Services") { |
| timeout(2) { |
| waitUntil { |
| ngic_dataplane_running = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| kubectl -n epc get pods | grep ngic-dp | grep -i running | grep 1/1 | wc -l |
| """ |
| return ngic_dataplane_running.toInteger() == 1 |
| } |
| } |
| |
| mcord_local_cdn_working = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| ngic_sgi_net_ip=\$(kubectl exec -n epc ngic-dp-0 ifconfig sgi-net | grep 'inet addr' | cut -d: -f2 | awk '{print \$1}') |
| helm install -n cdn-local --set remote_ip="10.90.0.152" --set spgwu_sgiip=\$ngic_sgi_net_ip --namespace epc cord/mcord-cdn-local |
| """ |
| } |
| |
| stage('Install CORD Kafka') { |
| timeout(10) { |
| sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 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 |
| """ |
| } |
| timeout(10) { |
| waitUntil { |
| kafka_instances_running = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| kubectl get pods | grep cord-kafka | grep -i running | grep 1/1 | wc -l |
| """ |
| return kafka_instances_running.toInteger() == 2 |
| } |
| } |
| } |
| // stage('Install Logging Infrastructure') { |
| // timeout(10) { |
| // sh returnStdout: true, script: """ |
| // export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| // 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 |
| // helm-repo-tools/wait_for_pods.sh |
| // """ |
| // } |
| // } |
| stage('Install Monitoring Infrastructure') { |
| timeout(10) { |
| sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n nem-monitoring cord/nem-monitoring --version 1.0.1 |
| helm-repo-tools/wait_for_pods.sh |
| """ |
| } |
| } |
| stage('Install ONOS') { |
| timeout(10) { |
| sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| helm install -n onos -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml cord/onos --version 1.1.0 |
| """ |
| } |
| timeout(10) { |
| waitUntil { |
| onos_completed = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| kubectl get pods | grep -i onos | grep -i running | grep 1/1 | wc -l |
| """ |
| return onos_completed.toInteger() == 1 |
| } |
| } |
| } |
| |
| stage('Install ONOS progRAN') { |
| timeout(10) { |
| sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| echo \$(pwd) |
| helm install -n onos-progran -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml cord/onos-progran |
| """ |
| } |
| timeout(10) { |
| waitUntil { |
| onos_progran_completed = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| kubectl get pods | grep -i onos-progran | grep -i running | grep 1/1 | wc -l |
| """ |
| return onos_progran_completed.toInteger() == 1 |
| } |
| } |
| timeout(2) { |
| sh returnStdout: true, script: """ |
| sshpass -p karaf ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30116 -l karaf ${deployment_config.nodes[0].ip} 'app deactivate org.onosproject.progran' |
| sshpass -p karaf ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30116 -l karaf ${deployment_config.nodes[0].ip} 'app activate org.onosproject.progran' |
| """ |
| } |
| } |
| |
| stage('Install xos-core') { |
| timeout(10) { |
| sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n xos-core cord/xos-core --version 2.3.3 |
| """ |
| } |
| timeout(10) { |
| waitUntil { |
| xos_core_completed = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| kubectl get pods | grep -i xos | grep -i running | grep 1/1 | wc -l |
| """ |
| return xos_core_completed.toInteger() == 6 |
| } |
| } |
| } |
| stage('Install M-CORD Profile') { |
| timeout(10) { |
| sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n mcord cord/mcord |
| """ |
| } |
| timeout(10) { |
| waitUntil { |
| tosca_completed = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| kubectl get pods | grep -i mcord-tosca-loader | grep -i completed | wc -l |
| """ |
| return tosca_completed.toInteger() == 1 |
| } |
| } |
| } |
| |
| // SEBA Begin |
| stage('Install SEBA Profile') { |
| timeout(10) { |
| sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 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 |
| """ |
| } |
| timeout(10) { |
| waitUntil { |
| tosca_completed = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| kubectl get pods | grep -i seba-services-tosca-loader | grep -i completed | wc -l |
| """ |
| return tosca_completed.toInteger() == 1 |
| } |
| } |
| } |
| |
| stage('Install base-kubernetes') { |
| timeout(10) { |
| sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n base-kubernetes cord/base-kubernetes --version 1.0.2 |
| """ |
| } |
| timeout(10) { |
| waitUntil { |
| base_kubernetes_tosca_running = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| kubectl get pods | grep -i base-kubernetes-tosca-loader | grep -i completed | wc -l |
| """ |
| return base_kubernetes_tosca_running.toInteger() == 1 |
| } |
| } |
| } |
| |
| stage('Install att workflow') { |
| timeout(10) { |
| sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| 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 |
| """ |
| } |
| timeout(10) { |
| waitUntil { |
| att_workflow_tosca_completed = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| kubectl get pods | grep -i att-workflow-tosca-loader | grep -i completed | wc -l |
| """ |
| return att_workflow_tosca_completed.toInteger() == 1 |
| } |
| } |
| } |
| |
| stage('Install voltha') { |
| timeout(10) { |
| sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf |
| helm install -n voltha -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml cord/voltha --set etcd.cluster.enabled=false --version 1.0.3 |
| """ |
| } |
| timeout(10) { |
| waitUntil { |
| voltha_completed = sh returnStdout: true, script: """ |
| export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf && |
| kubectl get pods -n voltha | grep -i running | grep 1/1 | wc -l |
| """ |
| return voltha_completed.toInteger() == 8 |
| } |
| } |
| } |
| // SEBA end |
| |
| if ( params.configurePod ) { |
| dir ("${configBaseDir}/${configToscaDir}/mcord") { |
| stage('Configure MCORD - Fabric') { |
| timeout(1) { |
| waitUntil { |
| out_fabric = sh returnStdout: true, script: """ |
| 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 |
| """ |
| return out_fabric.toInteger() == 1 |
| } |
| } |
| } |
| } |
| dir ("${configBaseDir}/${configToscaDir}/att-workflow") { |
| stage('Configure SEBA - Fabric and whitelist') { |
| timeout(1) { |
| waitUntil { |
| out_fabric = sh returnStdout: true, script: """ |
| 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 |
| """ |
| return out_fabric.toInteger() == 1 |
| } |
| } |
| } |
| stage('Configure SEBA - Subscriber') { |
| timeout(1) { |
| waitUntil { |
| out_subscriber = sh returnStdout: true, script: """ |
| 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 |
| """ |
| return out_subscriber.toInteger() == 1 |
| } |
| } |
| } |
| stage('Configure SEBA - OLT') { |
| timeout(1) { |
| waitUntil { |
| out_olt = sh returnStdout: true, script: """ |
| 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 |
| """ |
| return out_olt.toInteger() == 1 |
| } |
| } |
| } |
| } |
| } |
| currentBuild.result = 'SUCCESS' |
| } catch (err) { |
| println err.message |
| currentBuild.result = 'FAILURE' |
| step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false]) |
| } |
| echo "RESULT: ${currentBuild.result}" |
| } |
| } |