Updated dmi-build-and-test pipeline with option to choose Voltha Infra and Stack deployments

Change-Id: Iec45b090782eb53bf990f5807d21a46374dddd12
diff --git a/jjb/pipeline/voltha/master/dmi-build-and-test.groovy b/jjb/pipeline/voltha/master/dmi-build-and-test.groovy
index 3138e81..afa034f 100755
--- a/jjb/pipeline/voltha/master/dmi-build-and-test.groovy
+++ b/jjb/pipeline/voltha/master/dmi-build-and-test.groovy
@@ -93,11 +93,6 @@
       }
     }
     stage('Install Voltha')  {
-      when {
-        expression {
-          return installVoltha.toBoolean()
-        }
-      }
       steps {
         timeout(20) {
           installVoltctl("${branch}")
@@ -156,14 +151,18 @@
               etcdReplica: params.NumOfEtcd,
               bbsimReplica: bbsimReplicas.toInteger(),
               adaptersToWait: numberOfAdaptersToWait,
+              withVolthaInfra: installVolthaInfra.toBoolean(),
+              withVolthaStack: installVolthaStack.toBoolean(),
               ])
 
-            if(openoltAdapterChart != "onf/voltha-adapter-openolt"){
-              extraHelmFlags = extraHelmFlags + " --set global.log_level=${logLevel}"
-              deploy_custom_chart(volthaNamespace, oltAdapterReleaseName, openoltAdapterChart, extraHelmFlags)
-              waitForAdapters([
-                adaptersToWait: 2
-              ])
+            if(installVolthaStack.toBoolean()) {
+              if(openoltAdapterChart != "onf/voltha-adapter-openolt"){
+                extraHelmFlags = extraHelmFlags + " --set global.log_level=${logLevel}"
+                deploy_custom_chart(volthaNamespace, oltAdapterReleaseName, openoltAdapterChart, extraHelmFlags)
+                waitForAdapters([
+                  adaptersToWait: 2
+                ])
+              }
             }
           }
           sh """