[CORD-2966]v2
Parameterize the helm-api-test Jenkinsfile

Change-Id: I546d927fb759447de9ae92fa12a31c0be2a277ce
diff --git a/jjb/defaults.yaml b/jjb/defaults.yaml
index 5ca5ae9..e7d2896 100644
--- a/jjb/defaults.yaml
+++ b/jjb/defaults.yaml
@@ -40,8 +40,10 @@
 
     # regexp for gerrit triggers
     # list of supported branches, for branch-regexp
-    supported-branches-regexp: '^(master|cord-5.0|cord-4.1|cord-4.0)$'
+    supported-branches-regexp: '^(master|cord-6.0|cord-5.0|cord-4.1|cord-4.0)$'
+    modern-branches-regexp: '^(master|cord-6.0)$'
 
     # for matching files with file-include-regexp
     all-files-regexp: '.*'
     doc-files-regexp: "^docs/.*"
+
diff --git a/jjb/helm-api-test.yaml b/jjb/helm-api-test.yaml
index 45e8c5e..a9ec6a8 100644
--- a/jjb/helm-api-test.yaml
+++ b/jjb/helm-api-test.yaml
@@ -25,7 +25,22 @@
           build-timeout: '60'
           jenkins-ssh-credential: '{jenkins-ssh-credential}'
 
-    node: 'ubuntu16.04-basebuild-4c-8g'
+    parameters:
+      - string:
+         name: executorNode
+         default: 'ubuntu16.04-basebuild-4c-8g'
+         description: 'Name of the Jenkins node to run the job on'
+
+      - string:
+         name: manifestUrl
+         default: '{gerrit-server-url}/{cord-repo-manifest}'
+         description: 'URL to the repo manifest'
+
+      - string:
+         name: manifestBranch
+         default: '$GERRIT_BRANCH'
+         description: 'Name of the repo branch to use'
+
     project-type: pipeline
     concurrent: true
 
diff --git a/jjb/pipeline/helm-api-test.groovy b/jjb/pipeline/helm-api-test.groovy
index 68f4f6f..c776510 100644
--- a/jjb/pipeline/helm-api-test.groovy
+++ b/jjb/pipeline/helm-api-test.groovy
@@ -2,13 +2,37 @@
 
 pipeline {
 
+  parameters {
+    string(name:'executorNode', defaultValue:'invalid', description:'Name of the Jenkins node to run the job on')
+    string(name:'manifestUrl', defaultValue:'invalid', description:'URL to the repo manifest')
+    string(name:'manifestBranch', defaultValue:'master', description:'Name of the repo branch to use')
+  }
+
   /* no label, executor is determined by JJB */
   agent {
-    label ''
+    label '${params.executorNode}'
   }
 
   stages {
 
+    stage('checkout') {
+      steps {
+        checkout(changelog: false, \
+          poll: false,
+          scm: [$class: 'RepoScm', \
+            manifestRepositoryUrl: '${params.manifestUrl}', \
+            manifestBranch: '${params.manifestBranch}', \
+            currentBranch: true, \
+            destinationDir: 'cord', \
+            forceSync: true,
+            resetFirst: true, \
+            quiet: true, \
+            jobs: 4, \
+            showAllChanges: true] \
+          )
+      }
+    }
+
     stage('prep') {
       parallel {
 
@@ -30,10 +54,10 @@
                mkdir -p $HOME/.kube || true;
                touch $HOME/.kube/config;
                export KUBECONFIG=$HOME/.kube/config;
-               sudo -E minikube start --vm-driver=none;
+               minikube start --vm-driver=none;
 
-               sudo chown -R $USER $HOME/.minikube;
-               sudo chgrp -R $(id -g) $HOME/.minikube;
+               chown -R $USER $HOME/.minikube;
+               chgrp -R $(id -g) $HOME/.minikube;
 
                for i in {1..150}; do # timeout for 5 minutes
                    ./kubectl get po &> /dev/null
diff --git a/jjb/verify/helm-charts.yaml b/jjb/verify/helm-charts.yaml
index 23ade64..90930a8 100644
--- a/jjb/verify/helm-charts.yaml
+++ b/jjb/verify/helm-charts.yaml
@@ -7,7 +7,7 @@
 
     jobs:
       - 'verify-helm-charts-jobs':
-          branch-regexp: '^master$'
+          branch-regexp: '{modern-branches-regexp}'
 
 - job-group:
     name: 'verify-helm-charts-jobs'