Merge "Adding extraHelmFlags option to voltha-scale-measurements job to allow customizations"
diff --git a/jjb/pipeline/voltha-scale-measurements.groovy b/jjb/pipeline/voltha-scale-measurements.groovy
index bde5a8d..d336952 100644
--- a/jjb/pipeline/voltha-scale-measurements.groovy
+++ b/jjb/pipeline/voltha-scale-measurements.groovy
@@ -19,7 +19,6 @@
     ROBOT_MISC_ARGS="-d $WORKSPACE/RobotLogs -v teardown_device:False"
     SSHPASS="karaf"
     DEPLOY_K8S="n"
-    EXTRA_HELM_FLAGS="--set onu=${onuPerPon},pon=${ponPorts},delay=${BBSIMdelay},auth=${bbsimAuth},dhcp=${bbsimDhcp}"
   }
   stages {
     stage('set-description') {
@@ -57,31 +56,23 @@
       }
       steps {
         sh '''
-          helm install -n onos onf/onos --set images.onos.repository=voltha/voltha-onos --set images.onos.tag=4.0.1
+          IFS=: read -r onosRepo onosTag <<< ${onosImg}
+          helm install -n onos onf/onos --set images.onos.repository=${onosRepo} --set images.onos.tag=${onosTag} ${extraHelmFlags}
 
           IFS=: read -r volthaRepo volthaTag <<< ${volthaImg}
-          helm install -n voltha onf/voltha -f /home/cord/voltha-scale/voltha-values.yaml --set images.voltha.repository=${volthaRepo},images.voltha.tag=${volthaTag}
+          IFS=: read -r ofAgentRepo ofAgentTag <<< ${ofAgentImg}
+          helm install -n voltha onf/voltha -f /home/cord/voltha-scale/voltha-values.yaml --set images.voltha.repository=${volthaRepo},images.voltha.tag=${volthaTag},images.ofagent.repository=${ofAgentRepo},images.ofagent.tag=${ofAgentTag} ${extraHelmFlags}
 
           IFS=: read -r openoltAdapterRepo openoltAdapterTag <<< ${openoltAdapterImg}
-          helm install -n openolt onf/voltha-adapter-openolt -f /home/cord/voltha-scale/voltha-values.yaml --set images.adapter_open_olt.repository=${openoltAdapterRepo},images.adapter_open_olt.tag=${openoltAdapterTag}
+          helm install -n openolt onf/voltha-adapter-openolt -f /home/cord/voltha-scale/voltha-values.yaml --set images.adapter_open_olt.repository=${openoltAdapterRepo},images.adapter_open_olt.tag=${openoltAdapterTag} ${extraHelmFlags}
 
           IFS=: read -r openonuAdapterRepo openonuAdapterTag <<< ${openonuAdapterImg}
-          helm install -n openonu onf/voltha-adapter-openonu -f /home/cord/voltha-scale/voltha-values.yaml --set images.adapter_open_olt.repository=${openonuAdapterRepo},images.adapter_open_olt.tag=${openonuAdapterTag}
+          helm install -n openonu onf/voltha-adapter-openonu -f /home/cord/voltha-scale/voltha-values.yaml --set images.adapter_open_olt.repository=${openonuAdapterRepo},images.adapter_open_olt.tag=${openonuAdapterTag} ${extraHelmFlags}
 
           IFS=: read -r bbsimRepo bbsimTag <<< ${bbsimImg}
-          helm install -n bbsim onf/bbsim --set pon=${ponPorts},onu=${onuPerPon},auth=${bbsimAuth},dhcp=${bbsimDhcp},delay=${BBSIMdelay},images.bbsim.repository=${bbsimRepo},images.bbsim.tag=${bbsimTag}
-          helm install -n radius onf/freeradius
+          helm install -n bbsim onf/bbsim --set pon=${ponPorts},onu=${onuPerPon},auth=${bbsimAuth},dhcp=${bbsimDhcp},delay=${BBSIMdelay},images.bbsim.repository=${bbsimRepo},images.bbsim.tag=${bbsimTag} ${extraHelmFlags}
+          helm install -n radius onf/freeradius ${extraHelmFlags}
 
-          if [ ! -z ${bbsimImg} ];
-          then
-            IFS=: read -r bbsimRepo bbsimTag <<< ${bbsimImg}
-            EXTRA_HELM_FLAGS+=",images.bbsim.repository=${bbsimRepo},images.bbsim.tag=${bbsimTag}"
-          fi
-          if [ ! -z ${volthaImg} ];
-          then
-            IFS=: read -r volthaRepo volthaTag <<< ${volthaImg}
-            EXTRA_HELM_FLAGS+=",images.voltha.repository=${volthaRepo},images.voltha.tag=${volthaTag}"
-          fi
           bash /home/cord/voltha-scale/wait_for_pods.sh
           bash /home/cord/voltha-scale/start_port_forward.sh
           '''
@@ -235,4 +226,4 @@
 
     }
   }
-}
\ No newline at end of file
+}
diff --git a/jjb/voltha-scale.yaml b/jjb/voltha-scale.yaml
index e87c962..3ca77f6 100644
--- a/jjb/voltha-scale.yaml
+++ b/jjb/voltha-scale.yaml
@@ -257,6 +257,11 @@
           description: 'Custom image selection for VOLTHA (repo:tag)'
 
       - string:
+          name: ofAgentImg
+          default: 'voltha/voltha-ofagent:master'
+          description: 'Custom image selection for OfAgent (repo:tag)'
+
+      - string:
           name: openoltAdapterImg
           default: voltha/voltha-openolt-adapter:master
           description: 'Custom image selection for Openolt Adapter (repo:tag)'
@@ -266,6 +271,16 @@
           default: voltha/voltha-openonu-adapter:master
           description: 'Custom image selection for Openonu Adapter (repo:tag)'
 
+      - string:
+          name: onosImg
+          default: voltha/voltha-onos:4.0.1
+          description: 'Custom image selection for Openonu Adapter (repo:tag)'
+
+      - string:
+          name: extraHelmFlags
+          default: ''
+          description: 'Any extra helm parameters you want (passed to every helm install command)'
+
     project-type: pipeline
     concurrent: false
 
@@ -386,4 +401,4 @@
     project-type: pipeline
     concurrent: false
 
-    dsl: !include-raw-escape: pipeline/{pipeline-script}
\ No newline at end of file
+    dsl: !include-raw-escape: pipeline/{pipeline-script}