From 81ffa8ff9c4f9477a362f6b89eb308e6ffc33f03 Mon Sep 17 00:00:00 2001 From: "robert.tomczyk" Date: Fri, 14 Jun 2019 11:51:51 +0100 Subject: [PATCH] OPENDEV: Add patchset-created trigger for push upstream jenkins job. Updating all remaining OpenDev repositories with this change. Change-Id: Ib22df459acd28350968c0a9405dd3b11719eba0c --- ...-templates-opendev-push-upstream-test.yaml | 41 ------------------- ...lobal-templates-opendev-push-upstream.yaml | 2 +- .../opendev-sandbox-push-upstream-jobs.yml | 2 +- jjb/opendev/push-upstream-jobs.sh | 9 +++- 4 files changed, 9 insertions(+), 45 deletions(-) delete mode 100644 jjb/opendev/global-templates-opendev-push-upstream-test.yaml 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 index d4ba1f63d..000000000 --- a/jjb/opendev/global-templates-opendev-push-upstream-test.yaml +++ /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' diff --git a/jjb/opendev/global-templates-opendev-push-upstream.yaml b/jjb/opendev/global-templates-opendev-push-upstream.yaml index 385fdd4d0..addf5f41d 100644 --- a/jjb/opendev/global-templates-opendev-push-upstream.yaml +++ b/jjb/opendev/global-templates-opendev-push-upstream.yaml @@ -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: '**' diff --git a/jjb/opendev/opendev-sandbox/opendev-sandbox-push-upstream-jobs.yml b/jjb/opendev/opendev-sandbox/opendev-sandbox-push-upstream-jobs.yml index 375eac00f..8862f0676 100644 --- a/jjb/opendev/opendev-sandbox/opendev-sandbox-push-upstream-jobs.yml +++ b/jjb/opendev/opendev-sandbox/opendev-sandbox-push-upstream-jobs.yml @@ -26,4 +26,4 @@ branch: '{stream}' jobs: - - 'opendev-{project-name}-{stream}-push-upstream-test' + - 'opendev-{project-name}-{stream}-push-upstream' diff --git a/jjb/opendev/push-upstream-jobs.sh b/jjb/opendev/push-upstream-jobs.sh index 02337646d..83c858d99 100755 --- a/jjb/opendev/push-upstream-jobs.sh +++ b/jjb/opendev/push-upstream-jobs.sh @@ -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" -- 2.25.1