Updating att workflow build jenkinsfile

Change-Id: Ifcbd608e8552965d3d5eaa663b91dafa8a4d8aa6
diff --git a/Jenkinsfile-attworkflow-build b/Jenkinsfile-attworkflow-build
index b71ad9c..14789a8 100644
--- a/Jenkinsfile-attworkflow-build
+++ b/Jenkinsfile-attworkflow-build
@@ -16,14 +16,12 @@
     timeout (100) {
         try {
             stage ("Parse deployment configuration file") {
-                sh returnStdout: true, script: "rm -rf ${configBaseDir} 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: """
-                    git clone -b ${branch} ${cordRepoUrl}/helm-charts
                     export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
                     for hchart in \$(helm list -q | grep -E -v 'docker-registry|mavenrepo|ponnet');
                     do
@@ -76,161 +74,159 @@
                     }
                 }
             }
-            dir ("helm-charts") {
-                stage('Install CORD Kafka') {
-                    timeout(10) {
-                        sh returnStdout: true, script: """
-                        export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
-                        helm install -f examples/kafka-single.yaml --version 0.8.8 -n cord-kafka incubator/kafka
+            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
                         """
-                    }
-                    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
-                        }
+                        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 examples/logging-single.yaml -n logging cord/logging
-                        scripts/wait_for_pods.sh
+            }
+            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
+                    scripts/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
+                    scripts/wait_for_pods.sh
+                    """
+                }
+            }
+            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.0 -n etcd-operator stable/etcd-operator
+                    """
+                }
+                timeout(10) {
+                    waitUntil {
+                        etcd_running = sh returnStdout: true, script: """
+                        export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf &&
+                        kubectl get pods | grep etcd | grep -i running | grep 1/1 | wc -l
                         """
+                        return etcd_running.toInteger() == 3
                     }
                 }
-                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
-                        scripts/wait_for_pods.sh
+            }
+            stage('Install voltha') {
+                timeout(10) {
+                    sh returnStdout: true, script: """
+                    export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
+                    helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
+                    helm dep build voltha
+                    helm install -n voltha -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml cord/voltha
+                    """
+                }
+                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
                     }
                 }
-                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.0 -n etcd-operator stable/etcd-operator
+            }
+            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
+                    """
+                }
+                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 2/2 | wc -l
                         """
-                    }
-                    timeout(10) {
-                        waitUntil {
-                            etcd_running = sh returnStdout: true, script: """
-                            export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf &&
-                            kubectl get pods | grep etcd | grep -i running | grep 1/1 | wc -l
-                            """
-                            return etcd_running.toInteger() == 3
-                        }
+                        return onos_completed.toInteger() == 1
                     }
                 }
-                stage('Install voltha') {
-                    timeout(10) {
-                        sh returnStdout: true, script: """
-                        export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
-                        helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
-                        helm dep build voltha
-                        helm install -n voltha -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml cord/voltha
+            }
+            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
+                    """
+                }
+                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
                         """
-                    }
-                    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
-                        }
+                        return xos_core_completed.toInteger() == 6
                     }
                 }
-                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
+            }
+            stage('Install seba-services') {
+                timeout(10) {
+                    sh returnStdout: true, script: """
+                    export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
+                    helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n seba-services cord/seba-services
+                    """
+                }
+                timeout(10) {
+                    waitUntil {
+                        att_workflow_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
                         """
-                    }
-                    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 2/2 | wc -l
-                            """
-                            return onos_completed.toInteger() == 1
-                        }
+                        return att_workflow_tosca_completed.toInteger() == 1
                     }
                 }
-                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
+            }
+            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
+                    """
+                }
+                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
                         """
-                    }
-                    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
-                        }
+                        return base_kubernetes_tosca_running.toInteger() == 1
                     }
                 }
-                stage('Install seba-services profile') {
-                    timeout(10) {
-                        sh returnStdout: true, script: """
-                        export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
-                        helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n seba-services cord/seba-services
-                        """
-                    }
-                    timeout(10) {
-                        waitUntil {
-                            att_workflow_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 att_workflow_tosca_completed.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 cord/att-workflow
+                    """
                 }
-                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
+                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
                         """
-                    }
-                    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 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
-                        }
+                        return att_workflow_tosca_completed.toInteger() == 1
                     }
                 }
             }
@@ -327,22 +323,20 @@
                 }
             }
             if ( params.installBBSim ) {
-                dir ("helm-charts") {
-                    stage('Install BBSim') {
-                        timeout(10) {
-                            sh returnStdout: true, script: """
-                            export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
-                            helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n bbsim bbsim --set onus_per_pon_port=${onuNumber}
+                stage('Install BBSim') {
+                    timeout(10) {
+                        sh returnStdout: true, script: """
+                        export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
+                        helm install -f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n bbsim bbsim --set onus_per_pon_port=${onuNumber}
+                        """
+                    }
+                    timeout(10) {
+                        waitUntil {
+                            bbsim_running = sh returnStdout: true, script: """
+                            export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf &&
+                            kubectl get pods -n voltha | grep -i bbsim | wc -l
                             """
-                        }
-                        timeout(10) {
-                            waitUntil {
-                                base_kubernetes_tosca_running = sh returnStdout: true, script: """
-                                export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf &&
-                                kubectl get pods -n voltha | grep -i bbsim | wc -l
-                                """
-                                return base_kubernetes_tosca_running.toInteger() == 1
-                            }
+                            return bbsim_running.toInteger() == 1
                         }
                     }
                 }