Merge "CI: Uncomment voltha-go-controller publish jobs"
diff --git a/jjb/pipeline/voltha/physical-build.groovy b/jjb/pipeline/voltha/physical-build.groovy
index e9f3818..99871c5 100755
--- a/jjb/pipeline/voltha/physical-build.groovy
+++ b/jjb/pipeline/voltha/physical-build.groovy
@@ -120,6 +120,13 @@
       steps {
         timeout(20) {
           installVoltctl("${branch}")
+
+          sh """
+          sed -i -e "s/server: .*/server: voltha.${cluster}:443/" \
+              -e "s/kvstore: .*/kvstore: voltha-infra.${cluster}:443/" \
+              /home/jenkins/.volt/config
+          """
+
           script {
             // if we're downloading a voltha-helm-charts patch, then install from a local copy of the charts
             def localCharts = false
@@ -176,6 +183,7 @@
               bbsimReplica: bbsimReplicas.toInteger(),
               withFttb: withFttb.toBoolean(),
               adaptersToWait: numberOfAdaptersToWait,
+              cluster: cluster,
               ])
 
             if(openoltAdapterChart != "onf/voltha-adapter-openolt"){
diff --git a/jjb/pipeline/voltha/voltha-dt-physical-functional-tests.groovy b/jjb/pipeline/voltha/voltha-dt-physical-functional-tests.groovy
index 7ab29e2..ec2c00c 100644
--- a/jjb/pipeline/voltha/voltha-dt-physical-functional-tests.groovy
+++ b/jjb/pipeline/voltha/voltha-dt-physical-functional-tests.groovy
@@ -102,7 +102,6 @@
         script {
            deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml"
         }
-        installVoltctl("${branch}")
         sh """
         ps -ef | grep port-forward
         """
diff --git a/jjb/pipeline/voltha/voltha-physical-functional-tests.groovy b/jjb/pipeline/voltha/voltha-physical-functional-tests.groovy
index 3aa50e8..4cebe54 100644
--- a/jjb/pipeline/voltha/voltha-physical-functional-tests.groovy
+++ b/jjb/pipeline/voltha/voltha-physical-functional-tests.groovy
@@ -105,7 +105,6 @@
         script {
           deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}.yaml"
         }
-	installVoltctl("${branch}")
 
 	sh(returnStdout: false, script: """
 
diff --git a/jjb/pipeline/voltha/voltha-tt-physical-functional-tests.groovy b/jjb/pipeline/voltha/voltha-tt-physical-functional-tests.groovy
index 6f68e70..4470390 100644
--- a/jjb/pipeline/voltha/voltha-tt-physical-functional-tests.groovy
+++ b/jjb/pipeline/voltha/voltha-tt-physical-functional-tests.groovy
@@ -113,8 +113,6 @@
 		deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}-TT.yaml"
 	    }
 
-        installVoltctl("${branch}")
-
         sh returnStdout: false, script: """
         mkdir -p "$WORKSPACE/bin"
 
diff --git a/jjb/shell/github-release.sh b/jjb/shell/github-release.sh
index fe206ac..8cbd044 100755
--- a/jjb/shell/github-release.sh
+++ b/jjb/shell/github-release.sh
@@ -42,20 +42,12 @@
 ##--------------------##
 ##---]  INCLUDES  [---##
 ##--------------------##
-source "$libdir/help.sh"
-source "$libdir/parse-args.sh"
-
-## -----------------------------------------------------------------------
-## Uncomment to activate
-## -----------------------------------------------------------------------
-# declare -g -i debug
-
-# Debug arguments
-# declare -i -g argv_gen_version=1
-# declare -i -g draft_release=1
-
-declare -a -g ARGV=()           # Capture args to minimize globals and arg passing
-[[ $# -gt 0 ]] && ARGV=("$@")
+# If running locally, we can include help and parse-args. However, when run as
+# part of a CI build, these files are not included nor necessary.
+if [[ -d $libdir ]]; then
+    # source "$libdir/help.sh"  "usage" function is never called
+    source "$libdir/parse-args.sh"
+fi
 
 declare -g scratch              # temp workspace for downloads
 
@@ -153,7 +145,7 @@
 
     # shellcheck disable=SC2119
     do_logout
-    
+
     return
 }
 trap sigtrap EXIT
@@ -1103,7 +1095,9 @@
 iam="${0##*/}"
 
 full_banner
-parse_args "$@"
+if [[ $(type -t "parse_args" 2>/dev/null) == "function" ]]; then
+    parse_args "$@"
+fi
 init
 install_gh_binary
 
diff --git a/jjb/shell/publish-helm-repo.sh b/jjb/shell/publish-helm-repo.sh
index 75cb92c..f7e1ba7 100644
--- a/jjb/shell/publish-helm-repo.sh
+++ b/jjb/shell/publish-helm-repo.sh
@@ -48,7 +48,7 @@
 
   # Add changes and create commit
   git add -A
-  git commit -m "Changed by CORD Jenkins publish-helm-repo job: $BUILD_NUMBER, for project: $GERRIT_PROJECT, patchset: $GERRIT_CHANGE_NUMBER"
+  git commit -sm "Changed by CORD Jenkins publish-helm-repo job: $BUILD_NUMBER, for project: $GERRIT_PROJECT, patchset: $GERRIT_CHANGE_NUMBER"
 
   # create tag on new commit
   git tag "$NEW_VERSION"
diff --git a/jjb/voltha-scale.yaml b/jjb/voltha-scale.yaml
index 4786047..07735e4 100644
--- a/jjb/voltha-scale.yaml
+++ b/jjb/voltha-scale.yaml
@@ -732,7 +732,7 @@
           name: 'voltha-scale-measurements-lwc-dt-512'
           pipeline-script: 'voltha/voltha-scale-lwc-test.groovy'
           pipeline-branch: 'master'
-          build-node: 'berlin-community-pod-2'
+          build-node: 'jenkins-worker-02.berlin-lab'
           time-trigger: "H H * * *"
           disable-job: true
           withMonitoring: true
@@ -752,7 +752,7 @@
           name: 'voltha-scale-measurements-lwc-dt-256'
           pipeline-script: 'voltha/voltha-scale-lwc-test.groovy'
           pipeline-branch: 'master'
-          build-node: 'berlin-community-pod-2'
+          build-node: 'jenkins-worker-02.berlin-lab'
           time-trigger: "H H * * *"
           disable-job: true
           withMonitoring: true
diff --git a/jjb/voltha-test/voltha-nightly-jobs.yaml b/jjb/voltha-test/voltha-nightly-jobs.yaml
index 3f26acd..36e1140 100644
--- a/jjb/voltha-test/voltha-nightly-jobs.yaml
+++ b/jjb/voltha-test/voltha-nightly-jobs.yaml
@@ -58,6 +58,11 @@
           description: 'The config file'
 
       - string:
+          name: cluster
+          default: '{cluster}'
+          description: 'Name of the cluster'
+
+      - string:
           name: profile
           default: '{profile}'
           description: 'Technology Profile pushed to the ETCD'
diff --git a/jjb/voltha-test/voltha.yaml b/jjb/voltha-test/voltha.yaml
index ca6e064..ecaf270 100644
--- a/jjb/voltha-test/voltha.yaml
+++ b/jjb/voltha-test/voltha.yaml
@@ -29,8 +29,9 @@
       # -----------------------------------------------------------------------
       # Berlin pod with olt/onu - master versions timer based job , two OLTs
       - 'build_voltha_pod_release_timer':
-          build-node: 'berlin-community-pod-1'
+          build-node: 'jenkins-worker-01.berlin-lab'
           config-pod: 'berlin-community-pod-1-multi-olt'
+          cluster: 'pod-1.berlin-lab.lfbroadband.org'
           disable-job: true
           name-extension: '_DT'
           work-flow: 'DT'
@@ -43,8 +44,9 @@
       # Berlin POD test job - master versions: uses tech profile on voltha branch
       - 'build_voltha_pod_test':
           timeout: 360
-          build-node: 'berlin-community-pod-1'
+          build-node: 'jenkins-worker-01.berlin-lab'
           config-pod: 'berlin-community-pod-1-multi-olt'
+          cluster: 'pod-1.berlin-lab.lfbroadband.org'
           disable-job: true
           release: 'master'
           branch: 'master'
@@ -58,8 +60,9 @@
 
       # Berlin pod with gpon olt/onu - master 1T8GEM tech profile and timer based job
       - 'build_voltha_pod_release_timer':
-          build-node: 'berlin-community-pod-1'
+          build-node: 'jenkins-worker-01.berlin-lab'
           config-pod: 'berlin-community-pod-1-gpon'
+          cluster: 'pod-1.berlin-lab.lfbroadband.org'
           disable-job: false
           name-extension: '_DT'
           work-flow: 'DT'
@@ -72,8 +75,9 @@
       # Berlin POD test job - master versions: uses 1T8GEM tech profile on voltha branch
       - 'build_voltha_pod_test':
           timeout: 330
-          build-node: 'berlin-community-pod-1'
+          build-node: 'jenkins-worker-01.berlin-lab'
           config-pod: 'berlin-community-pod-1-gpon'
+          cluster: 'pod-1.berlin-lab.lfbroadband.org'
           disable-job: false
           name-extension: '_DT'
           work-flow: 'DT'
@@ -88,8 +92,9 @@
       # -----------------------------------------------------------------------
       # Berlin pod with gpon olt/onu - master 1T4GEM tech profile and timer based job
       - 'build_voltha_pod_release_timer':
-          build-node: 'berlin-community-pod-1'
+          build-node: 'jenkins-worker-01.berlin-lab'
           config-pod: 'berlin-community-pod-1-gpon-fttb'
+          cluster: 'pod-1.berlin-lab.lfbroadband.org'
           disable-job: true
           withFttb: true
           name-extension: '_DT'
@@ -102,8 +107,9 @@
       # Berlin POD test job - master versions: uses 1T4GEM tech profile on voltha branch
       - 'build_voltha_pod_test':
           timeout: 330
-          build-node: 'berlin-community-pod-1'
+          build-node: 'jenkins-worker-01.berlin-lab'
           config-pod: 'berlin-community-pod-1-gpon-fttb'
+          cluster: 'pod-1.berlin-lab.lfbroadband.org'
           disable-job: true
           withFttb: true
           name-extension: '_DT'
@@ -118,8 +124,9 @@
 
       # Berlin pod with zyxel gpon olt/onu - master 1T8GEM tech profile and timer based job
       - 'build_voltha_pod_release_timer':
-          build-node: 'berlin-community-pod-2'
+          build-node: 'jenkins-worker-02.berlin-lab'
           config-pod: 'berlin-community-pod-2-gpon-zyxel'
+          cluster: 'pod-2.berlin-lab.lfbroadband.org'
           disable-job: true
           name-extension: '_DT'
           work-flow: 'DT'
@@ -136,8 +143,9 @@
 
       # Berlin POD test job - zyxel gpon master versions: uses tech profile on voltha branch
       - 'build_voltha_pod_test':
-          build-node: 'berlin-community-pod-2'
+          build-node: 'jenkins-worker-02.berlin-lab'
           config-pod: 'berlin-community-pod-2-gpon-zyxel'
+          cluster: 'pod-2.berlin-lab.lfbroadband.org'
           disable-job: true
           release: 'master'
           branch: 'master'
@@ -151,8 +159,9 @@
 
       # Berlin pod with zyxel xgspon olt/onu - master 1T8GEM tech profile and timer based job
       - 'build_voltha_pod_release_timer':
-          build-node: 'berlin-community-pod-2'
+          build-node: 'jenkins-worker-02.berlin-lab'
           config-pod: 'berlin-community-pod-2-xgspon-zyxel'
+          cluster: 'pod-2.berlin-lab.lfbroadband.org'
           disable-job: true
           name-extension: '_DT'
           work-flow: 'DT'
@@ -169,8 +178,9 @@
 
       # Berlin POD test job - zyxel xgsgpon master versions: uses tech profile on voltha branch
       - 'build_voltha_pod_test':
-          build-node: 'berlin-community-pod-2'
+          build-node: 'jenkins-worker-02.berlin-lab'
           config-pod: 'berlin-community-pod-2-xgspon-zyxel'
+          cluster: 'pod-2.berlin-lab.lfbroadband.org'
           disable-job: true
           release: 'master'
           branch: 'master'
@@ -184,8 +194,9 @@
 
       # TT workflow on Zyxel XGSPON OLT at Berlin pod - build job
       - 'build_voltha_pod_release_timer':
-          build-node: 'berlin-community-pod-2'
+          build-node: 'jenkins-worker-02.berlin-lab'
           config-pod: 'berlin-community-pod-2-xgspon-zyxel'
+          cluster: 'pod-2.berlin-lab.lfbroadband.org'
           disable-job: true
           release: 'master'
           branch: 'master'
@@ -199,8 +210,9 @@
 
       # TT workflow on Zyxel XGSPON OLT at Berlin pod - test job
       - 'build_voltha_pod_test':
-          build-node: 'berlin-community-pod-2'
+          build-node: 'jenkins-worker-02.berlin-lab'
           config-pod: 'berlin-community-pod-2-xgspon-zyxel'
+          cluster: 'pod-2.berlin-lab.lfbroadband.org'
           disable-job: true
           release: 'master'
           branch: 'master'
@@ -216,8 +228,9 @@
 
       # [CORD-3256] TT workflow on XGSPON OLT at Berlin pod - build job
       - 'build_voltha_pod_release_timer':
-          build-node: 'berlin-community-pod-1'
+          build-node: 'jenkins-worker-01.berlin-lab'
           config-pod: 'berlin-community-pod-1-gpon'
+          cluster: 'pod-1.berlin-lab.lfbroadband.org'
           disable-job: true
           release: 'master'
           branch: 'master'
@@ -231,8 +244,9 @@
 
       # [CORD-3256] TT workflow on GPON OLT at Berlin pod - test job
       - 'build_voltha_pod_test':
-          build-node: 'berlin-community-pod-1'
+          build-node: 'jenkins-worker-01.berlin-lab'
           config-pod: 'berlin-community-pod-1-gpon'
+          cluster: 'pod-1.berlin-lab.lfbroadband.org'
           disable-job: true
           release: 'master'
           branch: 'master'
@@ -248,8 +262,9 @@
 
       # TT workflow on Zyxel GPON OLT at Berlin pod - build job (playground)
       - 'build_voltha_pod_release_timer_playground':
-          build-node: 'berlin-community-pod-1'
+          build-node: 'jenkins-worker-01.berlin-lab'
           config-pod: 'berlin-community-pod-1-gpon'
+          cluster: 'pod-1.berlin-lab.lfbroadband.org'
           disable-job: true
           release: 'master'
           branch: 'master'
@@ -263,8 +278,9 @@
 
       # TT workflow on Zyxel XGSPON OLT at Berlin pod - test job (playground)
       - 'build_voltha_pod_test_playground':
-          build-node: 'berlin-community-pod-1'
+          build-node: 'jenkins-worker-01.berlin-lab'
           config-pod: 'berlin-community-pod-1-gpon'
+          cluster: 'pod-1.berlin-lab.lfbroadband.org'
           disable-job: true
           release: 'master'
           branch: 'master'
@@ -280,8 +296,9 @@
 
       # Berlin pod with adtran gpon olt/onu - master 1T8GEM tech profile and timer based job
       - 'build_voltha_pod_release_timer':
-          build-node: 'berlin-community-pod-1'
+          build-node: 'jenkins-worker-01.berlin-lab'
           config-pod: 'berlin-community-pod-1-gpon-adtran'
+          cluster: 'pod-1.berlin-lab.lfbroadband.org'
           disable-job: true
           name-extension: '_DT'
           work-flow: 'DT'
@@ -302,8 +319,9 @@
       # Berlin POD adtran test job - master versions: uses 1T8GEM tech profile on voltha branch
       - 'build_voltha_pod_test':
           timeout: 390
-          build-node: 'berlin-community-pod-1'
+          build-node: 'jenkins-worker-01.berlin-lab'
           config-pod: 'berlin-community-pod-1-gpon-adtran'
+          cluster: 'pod-1.berlin-lab.lfbroadband.org'
           disable-job: true
           release: 'master'
           branch: 'master'
@@ -319,8 +337,9 @@
       # -----------------------------------------------------------------------
       # Berlin pod with adtran gpon olt/onu - 1T8GEM tech profile and timer based job
       - 'verify_voltha_pod_dmi_test':
-          build-node: 'berlin-community-pod-1'
+          build-node: 'jenkins-worker-01.berlin-lab'
           config-pod: 'berlin-community-pod-1-gpon-adtran'
+          cluster: 'pod-1.berlin-lab.lfbroadband.org'
           disable-job: true
           name-extension: '_DT'
           work-flow: 'DT'
diff --git a/vars/volthaInfraDeploy.groovy b/vars/volthaInfraDeploy.groovy
index 8ec3008..773cbb0 100644
--- a/vars/volthaInfraDeploy.groovy
+++ b/vars/volthaInfraDeploy.groovy
@@ -96,6 +96,7 @@
         // location of the kubernetes config file,
         // if null we assume it's stored in the $KUBECONFIG
         kubeconfig: null,
+        cluster: 'local'
     ]
 
     Map cfg = defaultConfig + config
@@ -145,7 +146,8 @@
           --set etcd.statefulset.replicaCount=${cfg.etcdReplica} \
           --set etcd.replicaCount=${cfg.etcdReplica} \
           --set etcd.ingress.enabled=true \
-          --set etcd.ingress.enableVirtualHosts=true \
+          --set etcd.ingress.hosts[0].host=voltha-infra.${cfg.cluster} \
+          --set etcd.ingress.hosts[0].paths[0]='/etcdserverpb.KV/' \
           -f $WORKSPACE/voltha-helm-charts/examples/${serviceConfigFile}-values.yaml ${cfg.extraHelmFlags}
 """)
 
diff --git a/vars/volthaStackDeploy.groovy b/vars/volthaStackDeploy.groovy
index 5ccae56..22d63f6 100644
--- a/vars/volthaStackDeploy.groovy
+++ b/vars/volthaStackDeploy.groovy
@@ -59,7 +59,8 @@
           --set global.voltha_infra_name=voltha-infra \
           --set voltha.onos_classic.replicas=${cfg.onosReplica} \
           --set voltha.ingress.enabled=true \
-          --set voltha.ingress.enableVirtualHosts=true \
+          --set voltha.ingress.hosts[0].host=voltha.${cfg.cluster} \
+          --set voltha.ingress.hosts[0].paths[0]='/voltha.VolthaService/' \
           --set global.voltha_infra_namespace=${cfg.infraNamespace} \
           ${cfg.extraHelmFlags}
 """)
@@ -328,6 +329,7 @@
         localCharts:     false,
         onosReplica:     1,
         adaptersToWait:  2,
+        cluster: 'voltha.local',
     ]
 
     Map cfg = defaultConfig + config