voltctl: update config generation in physical build

* add new parameter to voltha-test pipeline definitions for the
  cluster name
* after configuring the ingress on the clusters, the voltctl
  needs to point to the DNS names configured for the voltha and
  voltha-infra services.

Change-Id: Icaca9dc8dfed01887d98391bdb44adbad2775d68
Signed-off-by: Cristina de Francisco <cristina.defrancisco@bisdn.de>
diff --git a/jjb/pipeline/voltha/physical-build.groovy b/jjb/pipeline/voltha/physical-build.groovy
index e9f3818..6ed3a8f 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
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 a680ffd..ecaf270 100644
--- a/jjb/voltha-test/voltha.yaml
+++ b/jjb/voltha-test/voltha.yaml
@@ -31,6 +31,7 @@
       - 'build_voltha_pod_release_timer':
           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'
@@ -45,6 +46,7 @@
           timeout: 360
           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'
@@ -60,6 +62,7 @@
       - 'build_voltha_pod_release_timer':
           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'
@@ -74,6 +77,7 @@
           timeout: 330
           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'
@@ -90,6 +94,7 @@
       - 'build_voltha_pod_release_timer':
           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'
@@ -104,6 +109,7 @@
           timeout: 330
           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'
@@ -120,6 +126,7 @@
       - 'build_voltha_pod_release_timer':
           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'
@@ -138,6 +145,7 @@
       - 'build_voltha_pod_test':
           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'
@@ -153,6 +161,7 @@
       - 'build_voltha_pod_release_timer':
           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'
@@ -171,6 +180,7 @@
       - 'build_voltha_pod_test':
           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'
@@ -186,6 +196,7 @@
       - 'build_voltha_pod_release_timer':
           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'
@@ -201,6 +212,7 @@
       - 'build_voltha_pod_test':
           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'
@@ -218,6 +230,7 @@
       - 'build_voltha_pod_release_timer':
           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'
@@ -233,6 +246,7 @@
       - 'build_voltha_pod_test':
           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'
@@ -250,6 +264,7 @@
       - 'build_voltha_pod_release_timer_playground':
           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'
@@ -265,6 +280,7 @@
       - 'build_voltha_pod_test_playground':
           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'
@@ -282,6 +298,7 @@
       - 'build_voltha_pod_release_timer':
           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'
@@ -304,6 +321,7 @@
           timeout: 390
           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'
@@ -321,6 +339,7 @@
       - 'verify_voltha_pod_dmi_test':
           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'