Getting the new BBSim pipeline to RUN

Change-Id: I8d4f1d98890d761edaed7b3a05cea0ade60eddb0
diff --git a/jjb/pipeline/voltha-go-tests-new-bbsim.groovy b/jjb/pipeline/voltha-go-tests-new-bbsim.groovy
index 61c91f7..6dd5a95 100644
--- a/jjb/pipeline/voltha-go-tests-new-bbsim.groovy
+++ b/jjb/pipeline/voltha-go-tests-new-bbsim.groovy
@@ -31,6 +31,7 @@
     stage('Download kind-voltha') {
       steps {
         sh """
+           rm -rf kind-voltha
            git clone https://github.com/ciena/kind-voltha.git
            """
       }
@@ -45,25 +46,44 @@
       }
     }
 
-    stage('Deploy and run BBSim') {
-      // This step doing multple things as it is (hopefully) a temporary step
-      // once the new-bbsim is integrated with kind-voltha this all pipeline should be dismissed
+    stage('Download BBSim repo') {
       steps {
         sh """
           cd $WORKSPACE
+          rm -rf bbsim
           git clone https://github.com/opencord/bbsim.git bbsim
-          cd bbsim
-          # override sadis config
+          """
+      }
+    }
+
+    stage('config ONOS with BBSim sadis values') {
+      steps {
+        sh """
+          cd $WORKSPACE/bbsim
           curl --user karaf:karaf -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d @examples/sadis-minimal.json http://127.0.0.1:8181/onos/v1/network/configuration/apps
           curl --user karaf:karaf -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d @examples/onos-dhcp.json  http://127.0.0.1:8181/onos/v1/network/configuration/apps
-          # build and run BBSim
-          DOCKER_TAG=candidate make docker-build
-          TYPE=minimal kind load docker-image voltha/bbsim:candidate --name voltha-\$TYPE --nodes voltha-\$TYPE-worker,voltha-\$TYPE-worker2;
-          helm install -n bbsim deployments/helm-chart/bbsim/ --set images.bbsim.tag=candidate --set images.bbsim.pullPolicy=IfNotProsent
           """
       }
     }
 
+    stage('Build and Deploy BBSim') {
+      // This step doing multple things as it is (hopefully) a temporary step
+      // once the new-bbsim is integrated with kind-voltha this all pipeline should be dismissed
+      steps {
+        sh '''
+          cd $WORKSPACE/kind-voltha/
+          export KUBECONFIG="$(./bin/kind get kubeconfig-path --name="voltha-minimal")"
+          export VOLTCONFIG="/home/jenkins/.volt/config-minimal"
+          export PATH=$WORKSPACE/kind-voltha/bin:$PATH
+          cd $WORKSPACE/bbsim
+          # DOCKER_TAG=candidate make docker-build
+          # TYPE=minimal kind load docker-image voltha/bbsim:candidate --name voltha-\$TYPE --nodes voltha-\$TYPE-worker,voltha-\$TYPE-worker2;
+          # helm install -n bbsim deployments/helm-chart/bbsim/ --set images.bbsim.tag=candidate --set images.bbsim.pullPolicy=IfNotProsent
+          helm install -n bbsim deployments/helm-chart/bbsim/ --set images.bbsim.tag=master
+          '''
+      }
+    }
+
     stage('Run E2E Tests') {
       steps {
         sh '''