[VOL-3780] Supporting different workflows in the voltha-scale pipeline
Preserving kind-voltha based pipeline for 2.6 builds

Change-Id: I3c70a2c2b6f0a9e3ec0aa2b1c96375fa5b21558b
diff --git a/jjb/pipeline/voltha-scale-test.groovy b/jjb/pipeline/voltha-scale-test.groovy
index 6252c4e..ae0f63f 100644
--- a/jjb/pipeline/voltha-scale-test.groovy
+++ b/jjb/pipeline/voltha-scale-test.groovy
@@ -126,6 +126,31 @@
         }
       }
     }
+    stage('Clone voltha-helm-charts') {
+      steps {
+        checkout([
+          $class: 'GitSCM',
+          userRemoteConfigs: [[
+            url: "https://gerrit.opencord.org/voltha-helm-charts",
+            refspec: "${volthaHelmChartsChange}"
+          ]],
+          branches: [[ name: "master", ]],
+          extensions: [
+            [$class: 'WipeWorkspace'],
+            [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-helm-charts"],
+            [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
+          ],
+        ])
+        script {
+          sh(script:"""
+            if [ '${volthaHelmChartsChange}' != '' ] ; then
+              cd $WORKSPACE/voltha-helm-charts;
+              git fetch https://gerrit.opencord.org/voltha-helm-charts ${volthaHelmChartsChange} && git checkout FETCH_HEAD
+            fi
+            """)
+        }
+      }
+    }
     stage('Build patch') {
       when {
         expression {
@@ -173,13 +198,6 @@
 
             export EXTRA_HELM_FLAGS+=' '
 
-            # TODO add support for older releases, how do we do that?
-            # Load the release defaults
-            # if [ '${release.trim()}' != 'master' ]; then
-            #  source $WORKSPACE/kind-voltha/releases/${release}
-            #  EXTRA_HELM_FLAGS+=" ${extraHelmFlags} "
-            # fi
-
             # BBSim custom image handling
             if [ '${bbsimImg.trim()}' != '' ] && [ '\$GERRIT_PROJECT' != 'bbsim' ]; then
               IFS=: read -r bbsimRepo bbsimTag <<< '${bbsimImg.trim()}'
@@ -234,11 +252,7 @@
             echo "Installing with the following extra arguments:"
             echo $EXTRA_HELM_FLAGS
 
-            # if it's newer than voltha-2.4 set the correct BBSIM_CFG
-            # TODO customize the workflow
-            #if [ '${release.trim()}' != 'voltha-2.4' ]; then
-            #  export BBSIM_CFG="$WORKSPACE/kind-voltha/configs/bbsim-sadis-${workflow}.yaml"
-            #fi
+
 
             # Use custom built images
 
@@ -273,7 +287,8 @@
             helm upgrade --install voltha-infra onf/voltha-infra \
               --set onos-classic.replicas=${onosReplicas},onos-classic.atomix.replicas=${atomixReplicas} \
               --set etcd.enabled=false,kafka.enabled=false \
-              --set global.log_level=${logLevel}
+              --set global.log_level=${logLevel} \
+              -f $WORKSPACE/voltha-helm-charts/examples/${workflow}-values.yaml
 
             helm upgrade --install voltha1 onf/voltha-stack \
               --set global.stack_name=voltha1 \
@@ -296,7 +311,8 @@
               stackId=1
               helm upgrade --install bbsim\$i onf/bbsim --set olt_id="\${stackId}\${i}" \
                 --set onu=${onus},pon=${pons} \
-                --set defaults.log_level=${logLevel.toLowerCase()}
+                --set global.log_level=${logLevel.toLowerCase()} \
+                -f $WORKSPACE/voltha-helm-charts/examples/${workflow}-values.yaml
             done
 
             echo -ne "\nWaiting for VOLTHA to start..."