diff --git a/Jenkinsfile-attworkflow-build b/Jenkinsfile-attworkflow-build
index 6fec97c..02fd814 100644
--- a/Jenkinsfile-attworkflow-build
+++ b/Jenkinsfile-attworkflow-build
@@ -23,7 +23,7 @@
             stage('Clean up') {
                 timeout(10) {
                     sh returnStdout: true, script: """
-                    rm -rf helm-charts cord-tester
+                    rm -rf cord-tester
                     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');
@@ -61,170 +61,179 @@
                     // }
                 }
             }
-            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('Add CORD repository') {
+                sh returnStdout: true, script: """
+                export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
+                helm repo add cord https://charts.opencord.org
+                helm repo update
+                """
+                timeout(1) {
+                    waitUntil {
+                        cord_repo_present = sh returnStdout: true, script: """
+                        export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf &&
+                        helm repo list | grep cord | 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
-                        }
-                    }
-                }
-                stage('Install Logging Infrastructure') {
-                    timeout(10) {
-                        sh returnStdout: true, script: """
-                        export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
-                        helm dep update logging
-                        helm install -f examples/logging-single.yaml -n logging logging
-                        scripts/wait_for_pods.sh
-                        """
-                    }
-                }
-                stage('Install Monitoring Infrastructure') {
-                    timeout(10) {
-                        sh returnStdout: true, script: """
-                        export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
-                        helm dep update nem-monitoring
-                        helm install -n nem-monitoring 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 ../${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 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 ../${configBaseDir}/${configKubernetesDir}/${configFileName}.yml 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 ONOS') {
-                    timeout(10) {
-                        sh returnStdout: true, script: """
-                        export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
-                        helm install -n onos -f ../${configBaseDir}/${configKubernetesDir}/${configFileName}.yml 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
-                            """
-                            return onos_completed.toInteger() == 1
-                        }
-                    }
-                }
-                stage('Install xos-core') {
-                    timeout(10) {
-                        sh returnStdout: true, script: """
-                        export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
-                        helm dep update xos-core
-                        helm install -f ../${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n xos-core 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
-                            """
-                            return xos_core_completed.toInteger() == 6
-                        }
-                    }
-                }
-                stage('Install seba-services profile') {
-                    timeout(10) {
-                        sh returnStdout: true, script: """
-                        export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
-                        helm dep update xos-profiles/seba-services
-                        helm install -f ../${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n seba-services xos-profiles/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 base-kubernetes') {
-                    timeout(10) {
-                        sh returnStdout: true, script: """
-                        export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
-                        helm dep update xos-profiles/base-kubernetes
-                        helm install -f ../${configBaseDir}/${configKubernetesDir}/${configFileName}.yml -n base-kubernetes xos-profiles/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
-                            """
-                            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 dep update workflows/att-workflow
-                        helm install -f ../${configBaseDir}/${configKubernetesDir}/${configFileName}.yml --set att-workflow-driver.kafkaService=cord-kafka -n att-workflow workflows/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 cord_repo_present.toInteger() == 1
                     }
                 }
             }
+            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
+                    """
+                }
+                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 examples/logging-single.yaml -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 ../${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 ../${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 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 ../${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 ONOS') {
+                timeout(10) {
+                    sh returnStdout: true, script: """
+                    export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
+                    helm install -n onos -f ../${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
+                        """
+                        return onos_completed.toInteger() == 1
+                    }
+                }
+            }
+            stage('Install xos-core') {
+                timeout(10) {
+                    sh returnStdout: true, script: """
+                    export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
+                    helm install -f ../${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
+                        """
+                        return xos_core_completed.toInteger() == 6
+                    }
+                }
+            }
+            stage('Install seba-services profile') {
+                timeout(10) {
+                    sh returnStdout: true, script: """
+                    export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
+                    helm install -f ../${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 base-kubernetes') {
+                timeout(10) {
+                    sh returnStdout: true, script: """
+                    export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
+                    helm install -f ../${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
+                        """
+                        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 ../${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
+                    }
+                }
+            }
+
             if ( params.reinstallOlt ) {
                 stage('Reinstall OLT software') {
                     for(int i=0; i < deployment_config.olts.size(); i++) {
