OPENDEV: Add patchset-created trigger for push upstream jenkins job. 05/1405/2
authorrobert.tomczyk <robert.tomczyk@est.tech>
Fri, 14 Jun 2019 10:51:51 +0000 (11:51 +0100)
committerrobert.tomczyk <robert.tomczyk@est.tech>
Fri, 14 Jun 2019 11:44:03 +0000 (12:44 +0100)
Updating all remaining OpenDev repositories with this change.

Change-Id: Ib22df459acd28350968c0a9405dd3b11719eba0c

jjb/opendev/global-templates-opendev-push-upstream-test.yaml [deleted file]
jjb/opendev/global-templates-opendev-push-upstream.yaml
jjb/opendev/opendev-sandbox/opendev-sandbox-push-upstream-jobs.yml
jjb/opendev/push-upstream-jobs.sh

diff --git a/jjb/opendev/global-templates-opendev-push-upstream-test.yaml b/jjb/opendev/global-templates-opendev-push-upstream-test.yaml
deleted file mode 100644 (file)
index d4ba1f6..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-- job-template:
-    name: 'opendev-{project-name}-{stream}-push-upstream-test'
-
-    node: infra-build01-ubuntu1804
-
-    disabled: false
-
-    concurrent: true
-
-    properties:
-      - logrotate
-
-    parameters:
-      - project-parameters:
-          project: 'opendev/{project}'
-          branch: '{branch}'
-      - nordix-gerrit-parameters
-
-    scm:
-      - git-scm-gerrit:
-          ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
-          branch: '{branch}'
-          refspec: $GERRIT_REFSPEC
-
-    triggers:
-      - nordix-gerrit-patchset-created-or-push-upstream:
-          project: 'opendev/{project}'
-          branch: '{branch}'
-          files: '**'
-
-    wrappers:
-      - build-timeout:
-          timeout: 10
-
-    builders:
-      - shell:
-          !include-raw-escape: ./push-upstream-jobs.sh
-
-    publishers:
-      - notify-slack:
-          slack-channel: '#infra'
index 385fdd4d02abe76a5917b971096c2955be23b01a..addf5f41da03996f66812fccb9212834adcf914f 100644 (file)
@@ -23,7 +23,7 @@
           refspec: $GERRIT_REFSPEC
 
     triggers:
-      - nordix-gerrit-push-upstream:
+      - nordix-gerrit-patchset-created-or-push-upstream:
           project: 'opendev/{project}'
           branch: '{branch}'
           files: '**'
index 375eac00f727df94e8d40f0d6ab90fd1b25b66dc..8862f067693f046af2a6d0c8f80dd71e541a32e2 100644 (file)
@@ -26,4 +26,4 @@
           branch: '{stream}'
 
     jobs:
-      - 'opendev-{project-name}-{stream}-push-upstream-test'
+      - 'opendev-{project-name}-{stream}-push-upstream'
index 02337646d468628ac2ae8243f96d8725030b06ea..83c858d9901906946dc2bb7e80e3b86703200d3d 100755 (executable)
@@ -58,8 +58,13 @@ opendev_remote_url="ssh://$username@$opendev_gerrit_base/$opendev_project"
 
 # GERRIT_BRANCH is the _intended_ branch of the commit under review
 # E.g. git push HEAD:refs/for/master => GERRIT_BRANCH='master'
-# GERRIT_TOPIC is the rest of the refspec after GERRIT_BRANCH
-refspec="$commit_hash:refs/for/$GERRIT_BRANCH/$GERRIT_TOPIC"
+# GERRIT_TOPIC is the rest of the refspec after GERRIT_BRANCH when the topic
+# is set for the change.
+if [ -z "${GERRIT_TOPIC:-}" ] ; then
+    refspec="$commit_hash:refs/for/$GERRIT_BRANCH"
+else
+    refspec="$commit_hash:refs/for/$GERRIT_BRANCH/$GERRIT_TOPIC"
+fi
 
 echo >&2 "Pushing to OpenDev"