Merge "[VOL-2634] Updates to jenkins jobs/templates to provide ability to run PODs that have power switch for physical reboots"
diff --git a/jjb/cord-test/voltha.yaml b/jjb/cord-test/voltha.yaml
index 5c00fdb..36680d9 100644
--- a/jjb/cord-test/voltha.yaml
+++ b/jjb/cord-test/voltha.yaml
@@ -272,7 +272,7 @@
           config-pod: 'dt-berlin-pod'
           release: 'release'
           branch: 'master'
-          onos-version: '1.13.9'
+          onos-version: '2.2'
           test-repo: 'voltha-system-tests'
           Jenkinsfile: 'Jenkinsfile-voltha-bal31-build'
           oltDebVersion: 'openolt_asfvolt16_bal3.2.deb'
diff --git a/jjb/pipeline/voltha-bbsim-tests.groovy b/jjb/pipeline/voltha-bbsim-tests.groovy
index 6dbf5d2..1865276 100644
--- a/jjb/pipeline/voltha-bbsim-tests.groovy
+++ b/jjb/pipeline/voltha-bbsim-tests.groovy
@@ -84,16 +84,27 @@
     stage('Build Images') {
       steps {
         sh """
+           make-local () {
+             make -C $WORKSPACE/voltha/\$1 DOCKER_REPOSITORY=voltha/ DOCKER_TAG=citest docker-build
+           }
            if [ "${gerritProject}" = "pyvoltha" ]; then
-             cd $WORKSPACE/voltha/pyvoltha/
-             make dist
-             cd $WORKSPACE/voltha/voltha-openonu-adapter
+             make -C $WORKSPACE/voltha/pyvoltha/ dist
              export LOCAL_PYVOLTHA=$WORKSPACE/voltha/pyvoltha/
-             make local-pyvoltha
-             make DOCKER_REPOSITORY=voltha/ DOCKER_TAG=citest docker-build
+             make-local voltha-openonu-adapter
+           elif [ "${gerritProject}" = "voltha-lib-go" ]; then
+             make -C $WORKSPACE/voltha/voltha-lib-go/ build
+             export LOCAL_LIB_GO=$WORKSPACE/voltha/voltha-lib-go/
+             make-local voltha-go
+             make-local voltha-openolt-adapter
+           elif [ "${gerritProject}" = "voltha-protos" ]; then
+             make -C $WORKSPACE/voltha/voltha-protos/ build
+             export LOCAL_PROTOS=$WORKSPACE/voltha/voltha-protos/
+             make-local voltha-go
+             make-local voltha-openolt-adapter
+             make-local voltha-openonu-adapter
+             make-local ofagent-py
            elif ! [[ "${gerritProject}" =~ ^(voltha-helm-charts|voltha-system-tests)\$ ]]; then
-             cd $WORKSPACE/voltha/${gerritProject}/
-             make DOCKER_REPOSITORY=voltha/ DOCKER_TAG=citest docker-build
+             make-local ${gerritProject}
            fi
            """
       }
@@ -133,6 +144,10 @@
              IMAGES="bbsim "
            elif [ "${gerritProject}" = "pyvoltha" ]; then
              IMAGES="adapter_open_onu "
+           elif [ "${gerritProject}" = "voltha-lib-go" ]; then
+             IMAGES="rw_core ro_core adapter_open_olt "
+           elif [ "${gerritProject}" = "voltha-protos" ]; then
+             IMAGES="rw_core ro_core adapter_open_olt adapter_open_onu ofagent "
            else
              echo "No images to push"
            fi
@@ -232,7 +247,6 @@
             reportFileName: 'RobotLogs/report*.html',
             unstableThreshold: 0]);
          archiveArtifacts artifacts: '*.log,*.gz'
-
     }
   }
 }
diff --git a/jjb/verify/pyvoltha.yaml b/jjb/verify/pyvoltha.yaml
index 8bc15db..4100715 100644
--- a/jjb/verify/pyvoltha.yaml
+++ b/jjb/verify/pyvoltha.yaml
@@ -22,6 +22,7 @@
           dependency-jobs: 'verify_pyvoltha_tag-collision'
       - 'voltha-patch-test':
           pipeline-script: 'voltha-bbsim-tests.groovy'
+          skip-vote: true
 
 - job-group:
     name: 'publish-pyvoltha-jobs'
diff --git a/jjb/verify/voltha-helm-charts.yaml b/jjb/verify/voltha-helm-charts.yaml
index fd88c24..c7389bb 100644
--- a/jjb/verify/voltha-helm-charts.yaml
+++ b/jjb/verify/voltha-helm-charts.yaml
@@ -21,4 +21,4 @@
           dependency-jobs: 'verify_voltha-helm-charts_helm-lint'
           build-timeout: 20
           pipeline-script: 'voltha-bbsim-tests.groovy'
-          extra-helm-flags: '--set defaults.image_tag=null,images.onos.tag=2.2.0'
+          extra-helm-flags: '--set defaults.image_tag=null,images.onos.tag=4.0.0,images.onos.repository=voltha/voltha-onos'
diff --git a/jjb/verify/voltha-lib-go.yaml b/jjb/verify/voltha-lib-go.yaml
index 448cb7e..920ad07 100644
--- a/jjb/verify/voltha-lib-go.yaml
+++ b/jjb/verify/voltha-lib-go.yaml
@@ -21,3 +21,6 @@
           dest-gopath: "github.com/opencord"
           unit-test-targets: 'lint test'
           unit-test-keep-going: 'true'
+      - 'voltha-patch-test':
+          pipeline-script: 'voltha-bbsim-tests.groovy'
+          skip-vote: true
diff --git a/jjb/verify/voltha-protos.yaml b/jjb/verify/voltha-protos.yaml
index aefda8b..ef7b6ab 100644
--- a/jjb/verify/voltha-protos.yaml
+++ b/jjb/verify/voltha-protos.yaml
@@ -23,6 +23,9 @@
           build-timeout: 20
           unit-test-targets: 'test'
           unit-test-keep-going: 'true'
+      - 'voltha-patch-test':
+          pipeline-script: 'voltha-bbsim-tests.groovy'
+          skip-vote: true
 
 - job-group:
     name: 'post-merge-voltha-protos-jobs'
diff --git a/jjb/voltha-e2e.yaml b/jjb/voltha-e2e.yaml
index 8b8fff0..f898a90 100644
--- a/jjb/voltha-e2e.yaml
+++ b/jjb/voltha-e2e.yaml
@@ -164,6 +164,7 @@
     id: 'voltha-patch-test'
     name: 'verify_{project}_sanity-test{name-extension}'
     extra-helm-flags: ''
+    skip-vote: false
 
     description: |
       <!-- Managed by Jenkins Job Builder -->
@@ -222,16 +223,35 @@
     dsl: !include-raw-escape: pipeline/{pipeline-script}
 
     triggers:
-      - cord-infra-gerrit-trigger-patchset:
-          gerrit-server-name: '{gerrit-server-name}'
-          project-regexp: '^{project}$'
-          branch-regexp: '{branch-regexp}'
+      - gerrit:
+          server-name: '{gerrit-server-name}'
           dependency-jobs: '{dependency-jobs}'
-          file-include-regexp: '{all-files-regexp}'
+          silent-start: true
+          trigger-on:
+            - patchset-created-event:
+                exclude-drafts: true
+                exclude-trivial-rebase: false
+                exclude-no-code-change: true
+            - draft-published-event
+            - comment-added-contains-event:
+                comment-contains-value: '(?i)^.*recheck$'
+          projects:
+            - project-compare-type: REG_EXP
+              project-pattern: '^{project}$'
+              branches:
+                - branch-compare-type: REG_EXP
+                  branch-pattern: '{branch-regexp}'
+              file-paths:
+                - compare-type: REG_EXP
+                  pattern: '{all-files-regexp}'
+          skip-vote:
+            successful: '{skip-vote}'
+            failed: '{skip-vote}'
+            unstable: '{skip-vote}'
+            notbuilt: '{skip-vote}'
 
 # POD Per Patchset Pipeline Jobs
 
-
 - job-template:
     name: '{name}'
     id: verify_physical_voltha_patchset_auto