Merge "[VOL-3780] Syntax and param fix on the physical build pipeline"
diff --git a/jjb/pipeline/voltha/master/voltha-scale-test.groovy b/jjb/pipeline/voltha/master/voltha-scale-test.groovy
index 9f4cd86..2c99359 100644
--- a/jjb/pipeline/voltha/master/voltha-scale-test.groovy
+++ b/jjb/pipeline/voltha/master/voltha-scale-test.groovy
@@ -77,54 +77,13 @@
         }
       }
     }
-    stage('Clone voltha-system-tests') {
+    stage('Download Code') {
       steps {
-        checkout([
-          $class: 'GitSCM',
-          userRemoteConfigs: [[
-            url: "https://gerrit.opencord.org/voltha-system-tests",
-            refspec: "${volthaSystemTestsChange}"
-          ]],
-          branches: [[ name: "${release}", ]],
-          extensions: [
-            [$class: 'WipeWorkspace'],
-            [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"],
-            [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
-          ],
+        getVolthaCode([
+          branch: "${release}",
+          volthaSystemTestsChange: "${volthaSystemTestsChange}",
+          volthaHelmChartsChange: "${volthaHelmChartsChange}",
         ])
-        script {
-          sh(script:"""
-            if [ '${volthaSystemTestsChange}' != '' ] ; then
-              cd $WORKSPACE/voltha-system-tests;
-              git fetch https://gerrit.opencord.org/voltha-system-tests ${volthaSystemTestsChange} && git checkout FETCH_HEAD
-            fi
-            """)
-        }
-      }
-    }
-    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') {
@@ -282,11 +241,16 @@
 
             println "Passing the following parameters to the VOLTHA infra deploy: ${infraHelmFlags}."
 
+            def localCharts = false
+            if (volthaHelmChartsChange != "") {
+              localCharts = true
+            }
+
             volthaInfraDeploy([
               workflow: workflow,
               infraNamespace: "default",
               extraHelmFlags: infraHelmFlags,
-              localCharts: false, // TODO support custom charts
+              localCharts: localCharts,
               onosReplica: onosReplicas,
               atomixReplica: atomixReplicas,
             ])
diff --git a/jjb/voltha-scale.yaml b/jjb/voltha-scale.yaml
index 8ee694c..72032ce 100644
--- a/jjb/voltha-scale.yaml
+++ b/jjb/voltha-scale.yaml
@@ -402,7 +402,7 @@
       - string:
           name: release
           default: '{release}'
-          description: 'Version of the code to test (matches a branch in kind-voltha and voltha-system-tests repos)'
+          description: 'Version of the code to test (matches a branch in voltha-helm-charts and voltha-system-tests repos)'
 
       - string:
           name: buildNode
@@ -545,11 +545,6 @@
           description: 'Custom image selection for BBSIM (repo:tag)'
 
       - string:
-          name: bbsimChart
-          default: '{bbsimChart}'
-          description: 'BBSim chart name (or location on file system)'
-
-      - string:
           name: rwCoreImg
           default: '{rwCoreImg}'
           description: 'Custom image selection for VOLTHA (repo:tag)'
@@ -560,21 +555,11 @@
           description: 'Custom image selection for OfAgent (repo:tag), only supports the go version'
 
       - string:
-          name: volthaChart
-          default: '{volthaChart}'
-          description: 'VOLTHA chart name (or location on file system)'
-
-      - string:
           name: openoltAdapterImg
           default: '{openoltAdapterImg}'
           description: 'Custom image selection for Openolt Adapter (repo:tag)'
 
       - string:
-          name: openoltAdapterChart
-          default: '{openoltAdapterChart}'
-          description: 'OpenOLT chart name (or location on file system)'
-
-      - string:
           name: openonuAdapterImg
           default: '{openonuAdapterImg}'
           description: 'Custom image selection for Openonu Adapter (repo:tag)'
@@ -585,26 +570,11 @@
           description: 'Custom image selection for Openonu Go Adapter (repo:tag)'
 
       - string:
-          name: openonuAdapterChart
-          default: '{openonuAdapterChart}'
-          description: 'OpenONU chart name (or location on file system)'
-
-      - string:
           name: onosImg
           default: '{onosImg}'
           description: 'Custom image selection for Openonu Adapter (repo:tag)'
 
       - string:
-          name: onosChart
-          default: '{onosChart}'
-          description: 'ONOS chart name (or location on file system)'
-
-      - string:
-          name: radiusChart
-          default: '{radiusChart}'
-          description: 'freeradius chart name (or location on file system)'
-
-      - string:
           name: volthaSystemTestsChange
           default: '{volthaSystemTestsChange}'
           description: 'Download a change for gerrit in the voltha-system-tests repo, example value: "refs/changes/79/18779/13"'