From: Robert Tomczyk Date: Tue, 10 Sep 2019 17:17:17 +0000 (+0000) Subject: Merge "ACUMOS: Java 11 introduction" X-Git-Url: https://gerrit.nordix.org/gitweb?a=commitdiff_plain;h=06eef088d2234c4de89d222a36536c3650c5bfde;hp=882e7bac86e179f180d7fadd2227eb94433ae749;p=infra%2Fcicd.git Merge "ACUMOS: Java 11 introduction" --- diff --git a/jjb/geode/apache-geode-slave/slave_setup.sh b/jjb/geode/apache-geode-slave/slave_setup.sh index ef32cd12..306636a4 100755 --- a/jjb/geode/apache-geode-slave/slave_setup.sh +++ b/jjb/geode/apache-geode-slave/slave_setup.sh @@ -19,6 +19,20 @@ set -o nounset set -o errexit set -o pipefail set -o xtrace +DPKG_LOCK="/var/lib/dpkg/lock-frontend" + +# Wait for other apt process to finish by checking the dpkg lock file. +try=0 +while sudo lsof ${DPKG_LOCK} > /dev/null 2>&1 ; do + echo "DPKG file locked: ${DPKG_LOCK}." + echo " Waiting for another pkg instalaltion process to finish ..." + sleep 10 + if [[ ${try} -gt 60 ]] ; then + echo "ERROR: Max number of re-tries reached, exiting..." + exit 1 + fi + try=$((try + 1)) +done sudo apt-get update sudo apt-get install -y --no-install-recommends \ diff --git a/jjb/nolabs/deploy.sh b/jjb/nolabs/deploy.sh new file mode 100644 index 00000000..f1788e40 --- /dev/null +++ b/jjb/nolabs/deploy.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -o errexit +set -o nounset +set -o pipefail + +cd $WORKSPACE +echo "Info: Cleaning the previous deployment" +echo "-------------------------------------------------------------------------" +./stop.sh +echo "-------------------------------------------------------------------------" +echo "Info: Deploying the new version of nolabs" +echo "-------------------------------------------------------------------------" +./start.sh +echo "-------------------------------------------------------------------------" +echo "Info: Deployment successful!" diff --git a/jjb/nolabs/nolabs-jobs.yaml b/jjb/nolabs/nolabs-jobs.yaml new file mode 100644 index 00000000..d78969a5 --- /dev/null +++ b/jjb/nolabs/nolabs-jobs.yaml @@ -0,0 +1,168 @@ +--- +# +# ============LICENSE_START======================================================= +# Copyright (C) 2019 Nordix Foundation. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +- project: + name: 'nolabs' + + project: 'nolabs' + + stream: + - 'master': + branch: '{stream}' + + jobs: + - 'nolabs-verify-{stream}' + - 'nolabs-deploy-{stream}' + +- job-template: + name: 'nolabs-verify-{stream}' + + concurrent: false + + parameters: + - project-parameters: + project: '{project}' + branch: '{branch}' + - nordix-gerrit-parameters + - label: + name: SLAVE_LABEL + default: 'nolabs' + description: 'Slave label to schedule this job on.' + + properties: + - logrotate + - build-blocker: + use-build-blocker: true + blocking-jobs: + - 'nolabs-.*' + block-level: 'NODE' + - throttle: + max-per-node: 1 + max-total: 1 + option: project + + wrappers: + - build-timeout: + timeout: 10 + - fix-workspace-permissions + + scm: + - git-scm-gerrit: + ssh-credentials-id: nordixinfra-nordix-gerrit-ssh + branch: '{branch}' + refspec: $GERRIT_REFSPEC + wipe_workspace: true + clean_before: false + + triggers: + - gerrit: + server-name: 'Nordix Gerrit' + trigger-on: + - patchset-created-event: + exclude-drafts: 'false' + exclude-trivial-rebase: 'false' + exclude-no-code-change: 'false' + - draft-published-event + - comment-added-contains-event: + comment-contains-value: 'recheck' + - comment-added-contains-event: + comment-contains-value: 'reverify' + projects: + - project-compare-type: 'REG_EXP' + project-pattern: 'nolabs' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + disable-strict-forbidden-file-verification: 'false' + forbidden-file-paths: + - compare-type: ANT + pattern: '.gitignore' + - compare-type: ANT + pattern: '.gitreview' + + builders: + - shell: + !include-raw-escape: ./verify.sh + +- job-template: + name: 'nolabs-deploy-{stream}' + + concurrent: false + + parameters: + - project-parameters: + project: '{project}' + branch: '{branch}' + - nordix-gerrit-parameters + - label: + name: SLAVE_LABEL + default: 'nolabs' + description: 'Slave label to schedule this job on.' + + properties: + - logrotate + - build-blocker: + use-build-blocker: true + blocking-jobs: + - 'nolabs-.*' + block-level: 'NODE' + - throttle: + max-per-node: 1 + max-total: 1 + option: project + + wrappers: + - build-timeout: + timeout: 10 + - fix-workspace-permissions + + scm: + - git-scm: + ssh-credentials-id: nordixinfra-nordix-gerrit-ssh + branch: '{branch}' + refspec: '' + wipe_workspace: true + clean_before: false + + triggers: + - gerrit: + server-name: 'Nordix Gerrit' + trigger-on: + - change-merged-event + - comment-added-contains-event: + comment-contains-value: 'remerge' + projects: + - project-compare-type: 'ANT' + project-pattern: '{project}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + disable-strict-forbidden-file-verification: 'false' + forbidden-file-paths: + - compare-type: ANT + pattern: '.gitignore' + - compare-type: ANT + pattern: '.gitreview' + + builders: + - shell: + !include-raw-escape: ./deploy.sh + +# vim: set ts=2 sw=2 expandtab: diff --git a/jjb/nolabs/verify.sh b/jjb/nolabs/verify.sh new file mode 100644 index 00000000..4c3745f5 --- /dev/null +++ b/jjb/nolabs/verify.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -o errexit +set -o nounset +set -o pipefail + +cd $WORKSPACE +app=nolabs-verify-${BUILD_ID} +echo "Info: Building the container image nolabs-verify-${BUILD_ID}" +echo "-------------------------------------------------------------------------" +docker build -t $app . +echo "-------------------------------------------------------------------------" +echo "Info: Build successful!" +docker rmi -f $app > /dev/null diff --git a/jjb/onap/aai-oom/aai-oom-push-upstream-jobs.yaml b/jjb/onap/aai-oom/aai-oom-push-upstream-jobs.yaml index a657a165..9c25ac88 100644 --- a/jjb/onap/aai-oom/aai-oom-push-upstream-jobs.yaml +++ b/jjb/onap/aai-oom/aai-oom-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: aai-oom-push-upstream project: aai/oom project-name: aai-oom - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/aai-oom/aai-oom-rebase-jobs.yaml b/jjb/onap/aai-oom/aai-oom-rebase-jobs.yaml index 79a59942..98d331c5 100644 --- a/jjb/onap/aai-oom/aai-oom-rebase-jobs.yaml +++ b/jjb/onap/aai-oom/aai-oom-rebase-jobs.yaml @@ -25,9 +25,5 @@ project: aai/oom project-name: aai-oom - stream: - - master: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/aai-schema-service/aai-schema-service-push-upstream-jobs.yaml b/jjb/onap/aai-schema-service/aai-schema-service-push-upstream-jobs.yaml index fb4904aa..ad459884 100644 --- a/jjb/onap/aai-schema-service/aai-schema-service-push-upstream-jobs.yaml +++ b/jjb/onap/aai-schema-service/aai-schema-service-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: aai-schema-service-push-upstream project: aai/schema-service project-name: aai-schema-service - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/aai-schema-service/aai-schema-service-rebase-jobs.yaml b/jjb/onap/aai-schema-service/aai-schema-service-rebase-jobs.yaml index 02fd5437..c0c8f778 100644 --- a/jjb/onap/aai-schema-service/aai-schema-service-rebase-jobs.yaml +++ b/jjb/onap/aai-schema-service/aai-schema-service-rebase-jobs.yaml @@ -25,9 +25,5 @@ project: aai/schema-service project-name: aai-schema-service - stream: - - master: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/appc-cdt/appc-cdt-push-upstream-jobs.yaml b/jjb/onap/appc-cdt/appc-cdt-push-upstream-jobs.yaml index d2ae5e16..3fc66c26 100644 --- a/jjb/onap/appc-cdt/appc-cdt-push-upstream-jobs.yaml +++ b/jjb/onap/appc-cdt/appc-cdt-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: appc-cdt-push-upstream project: appc/cdt project-name: appc-cdt - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/appc-cdt/appc-cdt-rebase-jobs.yaml b/jjb/onap/appc-cdt/appc-cdt-rebase-jobs.yaml index 1de1e61b..bfbd3b8c 100644 --- a/jjb/onap/appc-cdt/appc-cdt-rebase-jobs.yaml +++ b/jjb/onap/appc-cdt/appc-cdt-rebase-jobs.yaml @@ -25,11 +25,5 @@ project: appc/cdt project-name: appc-cdt - stream: - - master: - branch: '{stream}' -# - casablanca: -# branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/appc-deployment/appc-deployment-push-upstream-jobs.yaml b/jjb/onap/appc-deployment/appc-deployment-push-upstream-jobs.yaml index 9d9e5d2b..dafe74c0 100644 --- a/jjb/onap/appc-deployment/appc-deployment-push-upstream-jobs.yaml +++ b/jjb/onap/appc-deployment/appc-deployment-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: appc-deployment-push-upstream project: appc/deployment project-name: appc-deployment - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/appc-deployment/appc-deployment-rebase-jobs.yaml b/jjb/onap/appc-deployment/appc-deployment-rebase-jobs.yaml index 64c59bc5..9cc8d044 100644 --- a/jjb/onap/appc-deployment/appc-deployment-rebase-jobs.yaml +++ b/jjb/onap/appc-deployment/appc-deployment-rebase-jobs.yaml @@ -25,11 +25,5 @@ project: appc/deployment project-name: appc-deployment - stream: - - master: - branch: '{stream}' -# - casablanca: -# branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/appc-parent/appc-parent-push-upstream-jobs.yaml b/jjb/onap/appc-parent/appc-parent-push-upstream-jobs.yaml index ae745cba..b761f1b6 100644 --- a/jjb/onap/appc-parent/appc-parent-push-upstream-jobs.yaml +++ b/jjb/onap/appc-parent/appc-parent-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: appc-parent-push-upstream project: appc/parent project-name: appc-parent - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/appc-parent/appc-parent-rebase-jobs.yaml b/jjb/onap/appc-parent/appc-parent-rebase-jobs.yaml index 7bb12a7a..ea935a18 100644 --- a/jjb/onap/appc-parent/appc-parent-rebase-jobs.yaml +++ b/jjb/onap/appc-parent/appc-parent-rebase-jobs.yaml @@ -25,11 +25,5 @@ project: appc/parent project-name: appc-parent - stream: - - master: - branch: '{stream}' -# - casablanca: -# branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/appc/appc-push-upstream-jobs.yaml b/jjb/onap/appc/appc-push-upstream-jobs.yaml index 7831c0d7..2f0358b4 100644 --- a/jjb/onap/appc/appc-push-upstream-jobs.yaml +++ b/jjb/onap/appc/appc-push-upstream-jobs.yaml @@ -23,11 +23,5 @@ project: appc project-name: appc - stream: - - master: - branch: '{stream}' -# - casablanca: -# branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/appc/appc-rebase-jobs.yaml b/jjb/onap/appc/appc-rebase-jobs.yaml index 1fb3de31..9a08ab69 100644 --- a/jjb/onap/appc/appc-rebase-jobs.yaml +++ b/jjb/onap/appc/appc-rebase-jobs.yaml @@ -24,10 +24,6 @@ name: appc-rebase project: appc project-name: appc - stream: - - master: - branch: '{stream}' -# - casablanca: -# branch: '{stream}' + jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/ccsdk-apps/ccsdk-apps-push-upstream-jobs.yaml b/jjb/onap/ccsdk-apps/ccsdk-apps-push-upstream-jobs.yaml index 61c09917..5ac47d84 100644 --- a/jjb/onap/ccsdk-apps/ccsdk-apps-push-upstream-jobs.yaml +++ b/jjb/onap/ccsdk-apps/ccsdk-apps-push-upstream-jobs.yaml @@ -23,11 +23,6 @@ name: ccsdk-apps-push-upstream project: ccsdk/apps project-name: ccsdk-apps - stream: - - master: - branch: '{stream}' - - dublin: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/ccsdk-apps/ccsdk-apps-rebase-jobs.yaml b/jjb/onap/ccsdk-apps/ccsdk-apps-rebase-jobs.yaml index c2e398f6..0f3ac2d9 100644 --- a/jjb/onap/ccsdk-apps/ccsdk-apps-rebase-jobs.yaml +++ b/jjb/onap/ccsdk-apps/ccsdk-apps-rebase-jobs.yaml @@ -25,11 +25,5 @@ project: ccsdk/apps project-name: ccsdk-apps - stream: - - master: - branch: '{stream}' - - dublin: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/ccsdk-cds/ccsdk-cds-push-upstream-jobs.yaml b/jjb/onap/ccsdk-cds/ccsdk-cds-push-upstream-jobs.yaml index 2a08c8e8..cd15e9ed 100644 --- a/jjb/onap/ccsdk-cds/ccsdk-cds-push-upstream-jobs.yaml +++ b/jjb/onap/ccsdk-cds/ccsdk-cds-push-upstream-jobs.yaml @@ -23,11 +23,6 @@ name: ccsdk-cds-push-upstream project: ccsdk/cds project-name: ccsdk-cds - stream: - - master: - branch: '{stream}' - - dublin: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/ccsdk-cds/ccsdk-cds-rebase-jobs.yaml b/jjb/onap/ccsdk-cds/ccsdk-cds-rebase-jobs.yaml index 35125f5c..391a1d67 100644 --- a/jjb/onap/ccsdk-cds/ccsdk-cds-rebase-jobs.yaml +++ b/jjb/onap/ccsdk-cds/ccsdk-cds-rebase-jobs.yaml @@ -25,11 +25,5 @@ project: ccsdk/cds project-name: ccsdk-cds - stream: - - master: - branch: '{stream}' - - dublin: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/ccsdk-platform-plugins/ccsdk-platform-plugins-push-upstream.yaml b/jjb/onap/ccsdk-platform-plugins/ccsdk-platform-plugins-push-upstream.yaml index 08c409db..1181c3f8 100644 --- a/jjb/onap/ccsdk-platform-plugins/ccsdk-platform-plugins-push-upstream.yaml +++ b/jjb/onap/ccsdk-platform-plugins/ccsdk-platform-plugins-push-upstream.yaml @@ -23,9 +23,6 @@ name: ccsdk-platfom-plugins-push-upstream project: ccsdk/platform/plugins project-name: ccsdk-platfom-plugins - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/ccsdk-platform-plugins/ccsdk-platform-plugins-rebase.yaml b/jjb/onap/ccsdk-platform-plugins/ccsdk-platform-plugins-rebase.yaml index dbe23196..709317cb 100644 --- a/jjb/onap/ccsdk-platform-plugins/ccsdk-platform-plugins-rebase.yaml +++ b/jjb/onap/ccsdk-platform-plugins/ccsdk-platform-plugins-rebase.yaml @@ -24,9 +24,6 @@ name: ccsdk-platfom-plugins-rebase project: ccsdk/platform/plugins project-name: ccsdk-platfom-plugins - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/ci-management/ci-management-push-upstream.yaml b/jjb/onap/ci-management/ci-management-push-upstream.yaml index 5a7b4089..e8037068 100644 --- a/jjb/onap/ci-management/ci-management-push-upstream.yaml +++ b/jjb/onap/ci-management/ci-management-push-upstream.yaml @@ -23,9 +23,6 @@ name: onap-ci-management-push-upstream project: ci-management project-name: ci-management - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/ci-management/ci-management-rebase.yaml b/jjb/onap/ci-management/ci-management-rebase.yaml index 52c5b852..6306b7d1 100644 --- a/jjb/onap/ci-management/ci-management-rebase.yaml +++ b/jjb/onap/ci-management/ci-management-rebase.yaml @@ -24,9 +24,6 @@ name: onap-ci-management-rebase project: ci-management project-name: ci-management - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/clamp/clamp-push-upstream-jobs.yaml b/jjb/onap/clamp/clamp-push-upstream-jobs.yaml index aac089fc..404cfc27 100644 --- a/jjb/onap/clamp/clamp-push-upstream-jobs.yaml +++ b/jjb/onap/clamp/clamp-push-upstream-jobs.yaml @@ -23,11 +23,5 @@ project: clamp project-name: clamp - stream: - - master: - branch: '{stream}' -# - casablanca: -# branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/clamp/clamp-rebase-jobs.yaml b/jjb/onap/clamp/clamp-rebase-jobs.yaml index 1f907e8c..2ea86eb0 100644 --- a/jjb/onap/clamp/clamp-rebase-jobs.yaml +++ b/jjb/onap/clamp/clamp-rebase-jobs.yaml @@ -24,10 +24,6 @@ name: clamp-rebase project: clamp project-name: clamp - stream: - - master: - branch: '{stream}' -# - casablanca: -# branch: '{stream}' + jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/dcaegen2-collectors-datafile/dcaegen2-collectors-datafile-push-upstream-jobs.yaml b/jjb/onap/dcaegen2-collectors-datafile/dcaegen2-collectors-datafile-push-upstream-jobs.yaml index 49a95cd7..dd597f71 100644 --- a/jjb/onap/dcaegen2-collectors-datafile/dcaegen2-collectors-datafile-push-upstream-jobs.yaml +++ b/jjb/onap/dcaegen2-collectors-datafile/dcaegen2-collectors-datafile-push-upstream-jobs.yaml @@ -23,11 +23,5 @@ project: dcaegen2/collectors/datafile project-name: dcaegen2-collectors-datafile - stream: - - master: - branch: '{stream}' - - dublin: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/dcaegen2-collectors-datafile/dcaegen2-collectors-datafile-rebase-jobs.yaml b/jjb/onap/dcaegen2-collectors-datafile/dcaegen2-collectors-datafile-rebase-jobs.yaml index 1aedb54b..e7a4d60c 100644 --- a/jjb/onap/dcaegen2-collectors-datafile/dcaegen2-collectors-datafile-rebase-jobs.yaml +++ b/jjb/onap/dcaegen2-collectors-datafile/dcaegen2-collectors-datafile-rebase-jobs.yaml @@ -24,11 +24,5 @@ project: dcaegen2/collectors/datafile project-name: dcaegen2-collectors-datafile - stream: - - master: - branch: '{stream}' - - dublin: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/dcaegen2-collectors/dcaegen2-collectors-push-upstream-jobs.yaml b/jjb/onap/dcaegen2-collectors/dcaegen2-collectors-push-upstream-jobs.yaml index bf2d73b8..23967ac5 100644 --- a/jjb/onap/dcaegen2-collectors/dcaegen2-collectors-push-upstream-jobs.yaml +++ b/jjb/onap/dcaegen2-collectors/dcaegen2-collectors-push-upstream-jobs.yaml @@ -22,10 +22,6 @@ name: dcaegen2-collectors-push-upstream project: dcaegen2/collectors project-name: dcaegen2-collectors - stream: - - master: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/dcaegen2-collectors/dcaegen2-collectors-rebase-jobs.yaml b/jjb/onap/dcaegen2-collectors/dcaegen2-collectors-rebase-jobs.yaml index 4f1792d2..a8a99e33 100644 --- a/jjb/onap/dcaegen2-collectors/dcaegen2-collectors-rebase-jobs.yaml +++ b/jjb/onap/dcaegen2-collectors/dcaegen2-collectors-rebase-jobs.yaml @@ -19,17 +19,9 @@ # this job gets triggered when a change is merged to # dcaegen2/collectors/datafile project on ONAP Gerrit. - project: - name: dcaegen2-collectors-rebase - project: dcaegen2/collectors - project-name: dcaegen2-collectors - stream: - - master: - branch: '{stream}' - - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/dcaegen2-deployments/dcaegen2-deployments-push-upstream.yaml b/jjb/onap/dcaegen2-deployments/dcaegen2-deployments-push-upstream.yaml index 1099dd78..9d0481a8 100644 --- a/jjb/onap/dcaegen2-deployments/dcaegen2-deployments-push-upstream.yaml +++ b/jjb/onap/dcaegen2-deployments/dcaegen2-deployments-push-upstream.yaml @@ -22,9 +22,6 @@ name: dcaegen2-deployments-push-upstream project: dcaegen2/deployments project-name: dcaegen2-deployments - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/dcaegen2-deployments/dcaegen2-deployments-rebase-jobs.yaml b/jjb/onap/dcaegen2-deployments/dcaegen2-deployments-rebase-jobs.yaml index 021d0002..0274fcef 100644 --- a/jjb/onap/dcaegen2-deployments/dcaegen2-deployments-rebase-jobs.yaml +++ b/jjb/onap/dcaegen2-deployments/dcaegen2-deployments-rebase-jobs.yaml @@ -20,16 +20,9 @@ # this job gets triggered when a change is merged to # dcaegen2/deployments project on ONAP Gerrit. - project: - name: dcaegen2-deployments-rebase - project: dcaegen2/deployments - project-name: dcaegen2-deployments - stream: - - master: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/dcaegen2-platform-blueprints/dcaegen2-platform-blueprints-push-upstream-jobs.yaml b/jjb/onap/dcaegen2-platform-blueprints/dcaegen2-platform-blueprints-push-upstream-jobs.yaml index fe9aa545..d8472b6d 100644 --- a/jjb/onap/dcaegen2-platform-blueprints/dcaegen2-platform-blueprints-push-upstream-jobs.yaml +++ b/jjb/onap/dcaegen2-platform-blueprints/dcaegen2-platform-blueprints-push-upstream-jobs.yaml @@ -22,9 +22,6 @@ name: dcaegen2-platform-blueprints-push-upstream project: dcaegen2/platform/blueprints project-name: dcaegen2-platform-blueprints - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/dcaegen2-platform-blueprints/dcaegen2-platform-blueprints-rebase-jobs.yaml b/jjb/onap/dcaegen2-platform-blueprints/dcaegen2-platform-blueprints-rebase-jobs.yaml index 80095e83..aff05ce6 100644 --- a/jjb/onap/dcaegen2-platform-blueprints/dcaegen2-platform-blueprints-rebase-jobs.yaml +++ b/jjb/onap/dcaegen2-platform-blueprints/dcaegen2-platform-blueprints-rebase-jobs.yaml @@ -20,16 +20,9 @@ # this job gets triggered when a change is merged to # dcaegen2/platform/blueprints project on ONAP Gerrit. - project: - name: dcaegen2-platform-blueprints-rebase project: dcaegen2/platform/blueprints project-name: dcaegen2-platform-blueprints - stream: - - master: - branch: '{stream}' - - casablanca: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/dcaegen2-platform-plugins/dcaegen2-platform-plugins-push-upstream.yaml b/jjb/onap/dcaegen2-platform-plugins/dcaegen2-platform-plugins-push-upstream.yaml index 48c03ef3..ace0bb60 100644 --- a/jjb/onap/dcaegen2-platform-plugins/dcaegen2-platform-plugins-push-upstream.yaml +++ b/jjb/onap/dcaegen2-platform-plugins/dcaegen2-platform-plugins-push-upstream.yaml @@ -23,9 +23,6 @@ name: dcaegen2-platform-plugins-push-upstream project: dcaegen2/platform/plugins project-name: dcaegen2-platform-plugins - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/dcaegen2-platform-plugins/dcaegen2-platform-plugins-rebase.yaml b/jjb/onap/dcaegen2-platform-plugins/dcaegen2-platform-plugins-rebase.yaml index d4ad518d..da7a4472 100644 --- a/jjb/onap/dcaegen2-platform-plugins/dcaegen2-platform-plugins-rebase.yaml +++ b/jjb/onap/dcaegen2-platform-plugins/dcaegen2-platform-plugins-rebase.yaml @@ -24,9 +24,6 @@ name: dcaegen2-platform-plugins-rebase project: dcaegen2/platform/plugins project-name: dcaegen2-platform-plugins - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/dcaegen2-services-pm-mapper/dcaegen2-services-pm-mapper-push-upstream-jobs.yaml b/jjb/onap/dcaegen2-services-pm-mapper/dcaegen2-services-pm-mapper-push-upstream-jobs.yaml index 227a9357..0e226ae7 100644 --- a/jjb/onap/dcaegen2-services-pm-mapper/dcaegen2-services-pm-mapper-push-upstream-jobs.yaml +++ b/jjb/onap/dcaegen2-services-pm-mapper/dcaegen2-services-pm-mapper-push-upstream-jobs.yaml @@ -23,11 +23,5 @@ project: dcaegen2/services/pm-mapper project-name: dcaegen2-services-pm-mapper - stream: - - master: - branch: '{stream}' - - dublin: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/dcaegen2-services-pm-mapper/dcaegen2-services-pm-mapper-rebase-jobs.yaml b/jjb/onap/dcaegen2-services-pm-mapper/dcaegen2-services-pm-mapper-rebase-jobs.yaml index 0d3f14dc..57d3492c 100644 --- a/jjb/onap/dcaegen2-services-pm-mapper/dcaegen2-services-pm-mapper-rebase-jobs.yaml +++ b/jjb/onap/dcaegen2-services-pm-mapper/dcaegen2-services-pm-mapper-rebase-jobs.yaml @@ -24,11 +24,5 @@ project: dcaegen2/services/pm-mapper project-name: dcaegen2-services-pm-mapper - stream: - - master: - branch: '{stream}' - - dublin: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/dcaegen2-services-prh/dcaegen2-services-prh-push-upstream-jobs.yaml b/jjb/onap/dcaegen2-services-prh/dcaegen2-services-prh-push-upstream-jobs.yaml index cd28d894..9df64e79 100644 --- a/jjb/onap/dcaegen2-services-prh/dcaegen2-services-prh-push-upstream-jobs.yaml +++ b/jjb/onap/dcaegen2-services-prh/dcaegen2-services-prh-push-upstream-jobs.yaml @@ -22,9 +22,6 @@ name: dcaegen2-services-prh-push-upstream project: dcaegen2/services/prh project-name: dcaegen2-services-prh - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/dcaegen2-services-prh/dcaegen2-services-prh-rebase-jobs.yaml b/jjb/onap/dcaegen2-services-prh/dcaegen2-services-prh-rebase-jobs.yaml index d55448ed..d979f2fc 100644 --- a/jjb/onap/dcaegen2-services-prh/dcaegen2-services-prh-rebase-jobs.yaml +++ b/jjb/onap/dcaegen2-services-prh/dcaegen2-services-prh-rebase-jobs.yaml @@ -20,14 +20,9 @@ # this job gets triggered when a change is merged to # dcaegen2/services/prh project on ONAP Gerrit. - project: - name: dcaegen2-services-prh-rebase project: dcaegen2/services/prh project-name: dcaegen2-services-prh - stream: - - master: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/dcaegen2/dcaegen2-push-upstream-jobs.yaml b/jjb/onap/dcaegen2/dcaegen2-push-upstream-jobs.yaml index f4ab2d5e..0dc9e4bc 100644 --- a/jjb/onap/dcaegen2/dcaegen2-push-upstream-jobs.yaml +++ b/jjb/onap/dcaegen2/dcaegen2-push-upstream-jobs.yaml @@ -22,11 +22,6 @@ name: dcaegen2-push-upstream project: dcaegen2 project-name: dcaegen2 - stream: - - master: - branch: '{stream}' - - casablanca: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/dcaegen2/dcaegen2-rebase-jobs.yaml b/jjb/onap/dcaegen2/dcaegen2-rebase-jobs.yaml index a69eaae2..cbe673d1 100644 --- a/jjb/onap/dcaegen2/dcaegen2-rebase-jobs.yaml +++ b/jjb/onap/dcaegen2/dcaegen2-rebase-jobs.yaml @@ -24,11 +24,5 @@ project: dcaegen2 project-name: dcaegen2 - stream: - - master: - branch: '{stream}' - - casablanca: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/dmaap-buscontroller/dmaap-buscontroller-push-upstream-jobs.yaml b/jjb/onap/dmaap-buscontroller/dmaap-buscontroller-push-upstream-jobs.yaml index ae883ca0..a94e6c39 100644 --- a/jjb/onap/dmaap-buscontroller/dmaap-buscontroller-push-upstream-jobs.yaml +++ b/jjb/onap/dmaap-buscontroller/dmaap-buscontroller-push-upstream-jobs.yaml @@ -22,11 +22,6 @@ name: dmaap-buscontroller-push-upstream project: dmaap/buscontroller project-name: dmaap-buscontroller - stream: - - master: - branch: '{stream}' - - casablanca: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/dmaap-buscontroller/dmaap-buscontroller-rebase-jobs.yaml b/jjb/onap/dmaap-buscontroller/dmaap-buscontroller-rebase-jobs.yaml index e0a59b13..9b3b4762 100644 --- a/jjb/onap/dmaap-buscontroller/dmaap-buscontroller-rebase-jobs.yaml +++ b/jjb/onap/dmaap-buscontroller/dmaap-buscontroller-rebase-jobs.yaml @@ -23,11 +23,6 @@ name: dmaap-buscontroller-rebase project: dmaap/buscontroller project-name: dmaap-buscontroller - stream: - - master: - branch: '{stream}' - - casablanca: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/dmaap-datarouter/dmaap-datarouter-push-upstream-jobs.yaml b/jjb/onap/dmaap-datarouter/dmaap-datarouter-push-upstream-jobs.yaml index c73aba33..4c0919d5 100644 --- a/jjb/onap/dmaap-datarouter/dmaap-datarouter-push-upstream-jobs.yaml +++ b/jjb/onap/dmaap-datarouter/dmaap-datarouter-push-upstream-jobs.yaml @@ -22,13 +22,6 @@ name: dmaap-datarouter-push-upstream project: dmaap/datarouter project-name: dmaap-datarouter - stream: - - master: - branch: '{stream}' - - casablanca: - branch: '{stream}' - - dublin: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/dmaap-datarouter/dmaap-datarouter-rebase-jobs.yaml b/jjb/onap/dmaap-datarouter/dmaap-datarouter-rebase-jobs.yaml index a0a70051..8c5b9895 100644 --- a/jjb/onap/dmaap-datarouter/dmaap-datarouter-rebase-jobs.yaml +++ b/jjb/onap/dmaap-datarouter/dmaap-datarouter-rebase-jobs.yaml @@ -23,13 +23,6 @@ name: dmaap-datarouter-rebase project: dmaap/datarouter project-name: dmaap-datarouter - stream: - - master: - branch: '{stream}' - - casablanca: - branch: '{stream}' - - dublin: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/dmaap-dbcapi/dmaap-dbcapi-push-upstream-jobs.yaml b/jjb/onap/dmaap-dbcapi/dmaap-dbcapi-push-upstream-jobs.yaml index 3b79f9ee..6d5c37b2 100644 --- a/jjb/onap/dmaap-dbcapi/dmaap-dbcapi-push-upstream-jobs.yaml +++ b/jjb/onap/dmaap-dbcapi/dmaap-dbcapi-push-upstream-jobs.yaml @@ -22,11 +22,6 @@ name: dmaap-dbcapi-push-upstream project: dmaap/dbcapi project-name: dmaap-dbcapi - stream: - - master: - branch: '{stream}' - - casablanca: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/dmaap-dbcapi/dmaap-dbcapi-rebase-jobs.yaml b/jjb/onap/dmaap-dbcapi/dmaap-dbcapi-rebase-jobs.yaml index fea3fba0..ce9ee2d1 100644 --- a/jjb/onap/dmaap-dbcapi/dmaap-dbcapi-rebase-jobs.yaml +++ b/jjb/onap/dmaap-dbcapi/dmaap-dbcapi-rebase-jobs.yaml @@ -23,11 +23,6 @@ name: dmaap-dbcapi-rebase project: dmaap/dbcapi project-name: dmaap-dbcapi - stream: - - master: - branch: '{stream}' - - casablanca: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/doc/doc-push-upstream.yaml b/jjb/onap/doc/doc-push-upstream.yaml index 5e9dc059..c8d4ab06 100644 --- a/jjb/onap/doc/doc-push-upstream.yaml +++ b/jjb/onap/doc/doc-push-upstream.yaml @@ -23,11 +23,6 @@ name: doc-push-upstream project: doc project-name: doc - stream: - - master: - branch: '{stream}' - - dublin: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/doc/doc-rebase.yaml b/jjb/onap/doc/doc-rebase.yaml index b268fb0f..eb238855 100644 --- a/jjb/onap/doc/doc-rebase.yaml +++ b/jjb/onap/doc/doc-rebase.yaml @@ -24,11 +24,6 @@ name: doc-rebase project: doc project-name: doc - stream: - - master: - branch: '{stream}' - - dublin: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/global-templates-onap-push-upstream.yaml b/jjb/onap/global-templates-onap-push-upstream.yaml index ab19211c..aefd2f18 100644 --- a/jjb/onap/global-templates-onap-push-upstream.yaml +++ b/jjb/onap/global-templates-onap-push-upstream.yaml @@ -1,7 +1,7 @@ - job-template: - name: 'onap-{project-name}-{stream}-push-upstream' + name: 'onap-{project-name}-push-upstream' - node: onap-ubuntu1604 + node: infra-ubuntu1804 disabled: false @@ -11,15 +11,16 @@ - logrotate parameters: - - project-parameters: - project: 'onap/{project}' - branch: '{branch}' + - string: + name: PROJECT + default: 'onap/{project}' + description: JJB configured PROJECT parameter to identify a Nordix Gerrit project - nordix-gerrit-parameters scm: - git-scm-gerrit: ssh-credentials-id: nordixinfra-nordix-gerrit-ssh - branch: '{branch}' + branch: $GERRIT_BRANCH refspec: $GERRIT_REFSPEC wipe_workspace: true clean_before: false @@ -27,7 +28,7 @@ triggers: - nordix-gerrit-push-upstream: project: 'onap/{project}' - branch: '{branch}' + branch: '**' files: '**' wrappers: diff --git a/jjb/onap/global-templates-onap-rebase.yaml b/jjb/onap/global-templates-onap-rebase.yaml index 5345d745..acb47909 100644 --- a/jjb/onap/global-templates-onap-rebase.yaml +++ b/jjb/onap/global-templates-onap-rebase.yaml @@ -1,5 +1,5 @@ - job-template: - name: 'onap-{project-name}-{stream}-rebase' + name: 'onap-{project-name}-rebase' node: infra-ubuntu1804 @@ -11,10 +11,11 @@ - logrotate parameters: - - project-parameters: - project: '{project}' - branch: '{branch}' - onap-gerrit-parameters + - string: + name: PROJECT + default: '{project}' + description: JJB configured PROJECT parameter to identify a Nordix Gerrit project - string: name: NORDIX_REMOTE default: 'ssh://infra@gerrit.nordix.org:29418/onap/{project}.git' @@ -23,15 +24,15 @@ scm: - git-scm: ssh-credentials-id: nordixinfra-lfn-gerrit-ssh - branch: '{branch}' + branch: 'master' refspec: '' - wipe_workspace: true - clean_before: false + wipe_workspace: false + clean_before: true triggers: - onap-gerrit-trigger-change-merged: project: '{project}' - branch: '{branch}' + branch: '**' files: '**' - timed: "@midnight" @@ -41,7 +42,7 @@ builders: - shell: - !include-raw-escape: ../global/rebase-jobs.sh + !include-raw-escape: ./rebase-jobs.sh publishers: - notify-slack: diff --git a/jjb/onap/integration-csit/integration-csit-push-upstream-jobs.yaml b/jjb/onap/integration-csit/integration-csit-push-upstream-jobs.yaml index eb86c516..bbc53ea1 100644 --- a/jjb/onap/integration-csit/integration-csit-push-upstream-jobs.yaml +++ b/jjb/onap/integration-csit/integration-csit-push-upstream-jobs.yaml @@ -22,13 +22,6 @@ name: integration-csit-push-upstream project: integration/csit project-name: integration-csit - stream: - - master: - branch: '{stream}' - - casablanca: - branch: '{stream}' - - dublin: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/integration-csit/integration-csit-rebase-jobs.yaml b/jjb/onap/integration-csit/integration-csit-rebase-jobs.yaml index aab79c8b..08e59d3a 100644 --- a/jjb/onap/integration-csit/integration-csit-rebase-jobs.yaml +++ b/jjb/onap/integration-csit/integration-csit-rebase-jobs.yaml @@ -24,13 +24,6 @@ name: integration-csit-rebase project: integration/csit project-name: integration-csit - stream: - - master: - branch: '{stream}' - - casablanca: - branch: '{stream}' - - dublin: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-rebase' \ No newline at end of file + - 'onap-{project-name}-rebase' \ No newline at end of file diff --git a/jjb/onap/integration/integration-push-upstream-jobs.yaml b/jjb/onap/integration/integration-push-upstream-jobs.yaml index 533ff56d..f6a10d47 100644 --- a/jjb/onap/integration/integration-push-upstream-jobs.yaml +++ b/jjb/onap/integration/integration-push-upstream-jobs.yaml @@ -22,13 +22,6 @@ name: integration-push-upstream project: integration project-name: integration - stream: - - master: - branch: '{stream}' - - casablanca: - branch: '{stream}' - - dublin: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/integration/integration-rebase-jobs.yaml b/jjb/onap/integration/integration-rebase-jobs.yaml index 4f53d29c..2eeac08f 100644 --- a/jjb/onap/integration/integration-rebase-jobs.yaml +++ b/jjb/onap/integration/integration-rebase-jobs.yaml @@ -24,13 +24,6 @@ name: integration-rebase project: integration project-name: integration - stream: - - master: - branch: '{stream}' - - casablanca: - branch: '{stream}' - - dublin: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-rebase' \ No newline at end of file + - 'onap-{project-name}-rebase' \ No newline at end of file diff --git a/jjb/onap/oom-offline-installer/oom-offline-installer-push-upstream.yaml b/jjb/onap/oom-offline-installer/oom-offline-installer-push-upstream.yaml index 1a198ca6..2ceab1f0 100644 --- a/jjb/onap/oom-offline-installer/oom-offline-installer-push-upstream.yaml +++ b/jjb/onap/oom-offline-installer/oom-offline-installer-push-upstream.yaml @@ -21,9 +21,7 @@ name: oom-offline-installer-push-upstream project: oom/offline-installer project-name: oom-offline-installer - stream: - - master: - branch: '{stream}' + jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/oom-offline-installer/oom-offline-installer-rebase.yaml b/jjb/onap/oom-offline-installer/oom-offline-installer-rebase.yaml index e5732c96..754e2393 100644 --- a/jjb/onap/oom-offline-installer/oom-offline-installer-rebase.yaml +++ b/jjb/onap/oom-offline-installer/oom-offline-installer-rebase.yaml @@ -22,9 +22,6 @@ name: oom-offline-installer-rebase project: oom/offline-installer project-name: oom-offline-installer - stream: - - master: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + jobs: + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/oom/oom-push-upstream-jobs.yaml b/jjb/onap/oom/oom-push-upstream-jobs.yaml index ef6caf36..73be650e 100644 --- a/jjb/onap/oom/oom-push-upstream-jobs.yaml +++ b/jjb/onap/oom/oom-push-upstream-jobs.yaml @@ -23,12 +23,5 @@ project: oom project-name: oom - stream: - - master: - branch: '{stream}' - - casablanca: - branch: '{stream}' - - staging: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/oom/oom-rebase-jobs.yaml b/jjb/onap/oom/oom-rebase-jobs.yaml index b48b35fc..838d2e9c 100644 --- a/jjb/onap/oom/oom-rebase-jobs.yaml +++ b/jjb/onap/oom/oom-rebase-jobs.yaml @@ -24,12 +24,6 @@ name: oom-rebase project: oom project-name: oom - stream: - - master: - branch: '{stream}' - - casablanca: - branch: '{stream}' - - staging: - branch: '{stream}' + jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/policy-apex-pdp/policy-apex-pdp-push-upstream-jobs.yaml b/jjb/onap/policy-apex-pdp/policy-apex-pdp-push-upstream-jobs.yaml index 7da2279b..795e63b2 100644 --- a/jjb/onap/policy-apex-pdp/policy-apex-pdp-push-upstream-jobs.yaml +++ b/jjb/onap/policy-apex-pdp/policy-apex-pdp-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: policy-apex-pdp-push-upstream project: policy/apex-pdp project-name: policy-apex-pdp - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/policy-apex-pdp/policy-apex-pdp-rebase-jobs.yaml b/jjb/onap/policy-apex-pdp/policy-apex-pdp-rebase-jobs.yaml index e1a7d55c..347a25d8 100644 --- a/jjb/onap/policy-apex-pdp/policy-apex-pdp-rebase-jobs.yaml +++ b/jjb/onap/policy-apex-pdp/policy-apex-pdp-rebase-jobs.yaml @@ -25,11 +25,5 @@ project: policy/apex-pdp project-name: policy-apex-pdp - stream: - - master: - branch: '{stream}' -# - casablanca: -# branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/policy-api/policy-api-push-upstream-jobs.yaml b/jjb/onap/policy-api/policy-api-push-upstream-jobs.yaml index b0549698..8e174903 100644 --- a/jjb/onap/policy-api/policy-api-push-upstream-jobs.yaml +++ b/jjb/onap/policy-api/policy-api-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: policy-api-push-upstream project: policy/api project-name: policy-api - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/policy-api/policy-api-rebase-jobs.yaml b/jjb/onap/policy-api/policy-api-rebase-jobs.yaml index 4e76e015..4867cfea 100644 --- a/jjb/onap/policy-api/policy-api-rebase-jobs.yaml +++ b/jjb/onap/policy-api/policy-api-rebase-jobs.yaml @@ -25,9 +25,5 @@ project: policy/api project-name: policy-api - stream: - - master: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/policy-common/policy-common-push-upstream-jobs.yaml b/jjb/onap/policy-common/policy-common-push-upstream-jobs.yaml index 3af2ade7..f14423ae 100644 --- a/jjb/onap/policy-common/policy-common-push-upstream-jobs.yaml +++ b/jjb/onap/policy-common/policy-common-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: policy-common-push-upstream project: policy/common project-name: policy-common - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/policy-common/policy-common-rebase-jobs.yaml b/jjb/onap/policy-common/policy-common-rebase-jobs.yaml index 4812096d..e0fbdb69 100644 --- a/jjb/onap/policy-common/policy-common-rebase-jobs.yaml +++ b/jjb/onap/policy-common/policy-common-rebase-jobs.yaml @@ -25,11 +25,5 @@ project: policy/common project-name: policy-common - stream: - - master: - branch: '{stream}' -# - casablanca: -# branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/policy-core/policy-core-push-upstream-jobs.yaml b/jjb/onap/policy-core/policy-core-push-upstream-jobs.yaml index 6f5db049..3a771f52 100644 --- a/jjb/onap/policy-core/policy-core-push-upstream-jobs.yaml +++ b/jjb/onap/policy-core/policy-core-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: policy-core-push-upstream project: policy/core project-name: policy-core - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/policy-core/policy-core-rebase-jobs.yaml b/jjb/onap/policy-core/policy-core-rebase-jobs.yaml index b1d1d21e..086661be 100644 --- a/jjb/onap/policy-core/policy-core-rebase-jobs.yaml +++ b/jjb/onap/policy-core/policy-core-rebase-jobs.yaml @@ -25,11 +25,5 @@ project: policy/core project-name: policy-core - stream: - - master: - branch: '{stream}' -# - casablanca: -# branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/policy-distribution/policy-distribution-push-upstream-jobs.yaml b/jjb/onap/policy-distribution/policy-distribution-push-upstream-jobs.yaml index be5cc010..824c027c 100644 --- a/jjb/onap/policy-distribution/policy-distribution-push-upstream-jobs.yaml +++ b/jjb/onap/policy-distribution/policy-distribution-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: policy-distribution-push-upstream project: policy/distribution project-name: policy-distribution - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/policy-distribution/policy-distribution-rebase-jobs.yaml b/jjb/onap/policy-distribution/policy-distribution-rebase-jobs.yaml index 59dd9ffe..2e5affd5 100644 --- a/jjb/onap/policy-distribution/policy-distribution-rebase-jobs.yaml +++ b/jjb/onap/policy-distribution/policy-distribution-rebase-jobs.yaml @@ -25,11 +25,5 @@ project: policy/distribution project-name: policy-distribution - stream: - - master: - branch: '{stream}' -# - casablanca: -# branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/policy-docker/policy-docker-push-upstream-jobs.yaml b/jjb/onap/policy-docker/policy-docker-push-upstream-jobs.yaml index 1f9ea8a4..bbae8685 100644 --- a/jjb/onap/policy-docker/policy-docker-push-upstream-jobs.yaml +++ b/jjb/onap/policy-docker/policy-docker-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: policy-docker-push-upstream project: policy/docker project-name: policy-docker - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/policy-docker/policy-docker-rebase-jobs.yaml b/jjb/onap/policy-docker/policy-docker-rebase-jobs.yaml index c3499e9c..f48c900f 100644 --- a/jjb/onap/policy-docker/policy-docker-rebase-jobs.yaml +++ b/jjb/onap/policy-docker/policy-docker-rebase-jobs.yaml @@ -25,9 +25,5 @@ project: policy/docker project-name: policy-docker - stream: - - master: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/policy-drools-applications/policy-drools-applications-push-upstream-jobs.yaml b/jjb/onap/policy-drools-applications/policy-drools-applications-push-upstream-jobs.yaml index 703bfb72..76661f64 100644 --- a/jjb/onap/policy-drools-applications/policy-drools-applications-push-upstream-jobs.yaml +++ b/jjb/onap/policy-drools-applications/policy-drools-applications-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: policy-drools-applications-push-upstream project: policy/drools-applications project-name: policy-drools-applications - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/policy-drools-applications/policy-drools-applications-rebase-jobs.yaml b/jjb/onap/policy-drools-applications/policy-drools-applications-rebase-jobs.yaml index 8ef5b614..a6e6ed72 100644 --- a/jjb/onap/policy-drools-applications/policy-drools-applications-rebase-jobs.yaml +++ b/jjb/onap/policy-drools-applications/policy-drools-applications-rebase-jobs.yaml @@ -25,11 +25,5 @@ project: policy/drools-applications project-name: policy-drools-applications - stream: - - master: - branch: '{stream}' -# - casablanca: -# branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/policy-drools-pdp/policy-drools-pdp-push-upstream-jobs.yaml b/jjb/onap/policy-drools-pdp/policy-drools-pdp-push-upstream-jobs.yaml index 0ee571da..f977c7ff 100644 --- a/jjb/onap/policy-drools-pdp/policy-drools-pdp-push-upstream-jobs.yaml +++ b/jjb/onap/policy-drools-pdp/policy-drools-pdp-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: policy-drools-pdp-push-upstream project: policy/drools-pdp project-name: policy-drools-pdp - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/policy-drools-pdp/policy-drools-pdp-rebase-jobs.yaml b/jjb/onap/policy-drools-pdp/policy-drools-pdp-rebase-jobs.yaml index 6f0f0d81..994c5523 100644 --- a/jjb/onap/policy-drools-pdp/policy-drools-pdp-rebase-jobs.yaml +++ b/jjb/onap/policy-drools-pdp/policy-drools-pdp-rebase-jobs.yaml @@ -25,11 +25,5 @@ project: policy/drools-pdp project-name: policy-drools-pdp - stream: - - master: - branch: '{stream}' -# - casablanca: -# branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/policy-engine/policy-engine-push-upstream-jobs.yaml b/jjb/onap/policy-engine/policy-engine-push-upstream-jobs.yaml index f9765ded..fbd87bc4 100644 --- a/jjb/onap/policy-engine/policy-engine-push-upstream-jobs.yaml +++ b/jjb/onap/policy-engine/policy-engine-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: policy-engine-push-upstream project: policy/engine project-name: policy-engine - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/policy-engine/policy-engine-rebase-jobs.yaml b/jjb/onap/policy-engine/policy-engine-rebase-jobs.yaml index 24da2854..f49b269f 100644 --- a/jjb/onap/policy-engine/policy-engine-rebase-jobs.yaml +++ b/jjb/onap/policy-engine/policy-engine-rebase-jobs.yaml @@ -25,11 +25,5 @@ project: policy/engine project-name: policy-engine - stream: - - master: - branch: '{stream}' -# - casablanca: -# branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/policy-gui/policy-gui-push-upstream-jobs.yaml b/jjb/onap/policy-gui/policy-gui-push-upstream-jobs.yaml index 9176bf07..7980e46f 100644 --- a/jjb/onap/policy-gui/policy-gui-push-upstream-jobs.yaml +++ b/jjb/onap/policy-gui/policy-gui-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: policy-gui-push-upstream project: policy/gui project-name: policy-gui - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/policy-gui/policy-gui-rebase-jobs.yaml b/jjb/onap/policy-gui/policy-gui-rebase-jobs.yaml index c143b907..7f6bb7c3 100644 --- a/jjb/onap/policy-gui/policy-gui-rebase-jobs.yaml +++ b/jjb/onap/policy-gui/policy-gui-rebase-jobs.yaml @@ -25,9 +25,5 @@ project: policy/gui project-name: policy-gui - stream: - - master: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/policy-models/policy-models-push-upstream-jobs.yaml b/jjb/onap/policy-models/policy-models-push-upstream-jobs.yaml index 1f4ad85a..5104b101 100644 --- a/jjb/onap/policy-models/policy-models-push-upstream-jobs.yaml +++ b/jjb/onap/policy-models/policy-models-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: policy-models-push-upstream project: policy/models project-name: policy-models - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/policy-models/policy-models-rebase-jobs.yaml b/jjb/onap/policy-models/policy-models-rebase-jobs.yaml index f5bc7dbc..39c937ce 100644 --- a/jjb/onap/policy-models/policy-models-rebase-jobs.yaml +++ b/jjb/onap/policy-models/policy-models-rebase-jobs.yaml @@ -25,11 +25,5 @@ project: policy/models project-name: policy-models - stream: - - master: - branch: '{stream}' -# - casablanca: -# branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/policy-oom/policy-oom-push-upstream-jobs.yaml b/jjb/onap/policy-oom/policy-oom-push-upstream-jobs.yaml index f73f6237..e53905d2 100644 --- a/jjb/onap/policy-oom/policy-oom-push-upstream-jobs.yaml +++ b/jjb/onap/policy-oom/policy-oom-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: policy-oom-push-upstream project: policy/oom project-name: policy-oom - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/policy-oom/policy-oom-rebase-jobs.yaml b/jjb/onap/policy-oom/policy-oom-rebase-jobs.yaml index 49643501..c661edfd 100644 --- a/jjb/onap/policy-oom/policy-oom-rebase-jobs.yaml +++ b/jjb/onap/policy-oom/policy-oom-rebase-jobs.yaml @@ -25,9 +25,5 @@ project: policy/oom project-name: policy-oom - stream: - - master: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/policy-pap/policy-pap-push-upstream-jobs.yaml b/jjb/onap/policy-pap/policy-pap-push-upstream-jobs.yaml index 7e597876..3c8defbf 100644 --- a/jjb/onap/policy-pap/policy-pap-push-upstream-jobs.yaml +++ b/jjb/onap/policy-pap/policy-pap-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: policy-pap-push-upstream project: policy/pap project-name: policy-pap - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/policy-pap/policy-pap-rebase-jobs.yaml b/jjb/onap/policy-pap/policy-pap-rebase-jobs.yaml index a28ab2c4..164ab16e 100644 --- a/jjb/onap/policy-pap/policy-pap-rebase-jobs.yaml +++ b/jjb/onap/policy-pap/policy-pap-rebase-jobs.yaml @@ -25,9 +25,5 @@ project: policy/pap project-name: policy-pap - stream: - - master: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/policy-parent/policy-parent-push-upstream-jobs.yaml b/jjb/onap/policy-parent/policy-parent-push-upstream-jobs.yaml index c0f80ba4..6340da9c 100644 --- a/jjb/onap/policy-parent/policy-parent-push-upstream-jobs.yaml +++ b/jjb/onap/policy-parent/policy-parent-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: policy-parent-push-upstream project: policy/parent project-name: policy-parent - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/policy-parent/policy-parent-rebase-jobs.yaml b/jjb/onap/policy-parent/policy-parent-rebase-jobs.yaml index 3351c12b..d593a9e6 100644 --- a/jjb/onap/policy-parent/policy-parent-rebase-jobs.yaml +++ b/jjb/onap/policy-parent/policy-parent-rebase-jobs.yaml @@ -25,11 +25,5 @@ project: policy/parent project-name: policy-parent - stream: - - master: - branch: '{stream}' -# - casablanca: -# branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/policy-pdp/policy-pdp-push-upstream-jobs.yaml b/jjb/onap/policy-pdp/policy-pdp-push-upstream-jobs.yaml index e251da85..ac654c3f 100644 --- a/jjb/onap/policy-pdp/policy-pdp-push-upstream-jobs.yaml +++ b/jjb/onap/policy-pdp/policy-pdp-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: policy-pdp-push-upstream project: policy/pdp project-name: policy-pdp - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/policy-pdp/policy-pdp-rebase-jobs.yaml b/jjb/onap/policy-pdp/policy-pdp-rebase-jobs.yaml index 2950bd6a..4a7b7a29 100644 --- a/jjb/onap/policy-pdp/policy-pdp-rebase-jobs.yaml +++ b/jjb/onap/policy-pdp/policy-pdp-rebase-jobs.yaml @@ -25,9 +25,5 @@ project: policy/pdp project-name: policy-pdp - stream: - - master: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/policy-xacml-pdp/policy-xacml-pdp-push-upstream-jobs.yaml b/jjb/onap/policy-xacml-pdp/policy-xacml-pdp-push-upstream-jobs.yaml index bdeba08a..c712defe 100644 --- a/jjb/onap/policy-xacml-pdp/policy-xacml-pdp-push-upstream-jobs.yaml +++ b/jjb/onap/policy-xacml-pdp/policy-xacml-pdp-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: policy-xacml-pdp-push-upstream project: policy/xacml-pdp project-name: policy-xacml-pdp - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/policy-xacml-pdp/policy-xacml-pdp-rebase-jobs.yaml b/jjb/onap/policy-xacml-pdp/policy-xacml-pdp-rebase-jobs.yaml index 8f023874..24b3fef6 100644 --- a/jjb/onap/policy-xacml-pdp/policy-xacml-pdp-rebase-jobs.yaml +++ b/jjb/onap/policy-xacml-pdp/policy-xacml-pdp-rebase-jobs.yaml @@ -25,11 +25,5 @@ project: policy/xacml-pdp project-name: policy-xacml-pdp - stream: - - master: - branch: '{stream}' -# - casablanca: -# branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/portal/portal-push-upstream-jobs.yaml b/jjb/onap/portal/portal-push-upstream-jobs.yaml index 14f19e7c..93ae2408 100644 --- a/jjb/onap/portal/portal-push-upstream-jobs.yaml +++ b/jjb/onap/portal/portal-push-upstream-jobs.yaml @@ -22,9 +22,6 @@ name: portal-push-upstream project: portal project-name: portal - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/portal/portal-rebase-jobs.yaml b/jjb/onap/portal/portal-rebase-jobs.yaml index b97d9c65..75dc840f 100644 --- a/jjb/onap/portal/portal-rebase-jobs.yaml +++ b/jjb/onap/portal/portal-rebase-jobs.yaml @@ -24,9 +24,5 @@ project: portal project-name: portal - stream: - - master: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/push-upstream-jobs.sh b/jjb/onap/push-upstream-jobs.sh index 7f00fa31..6557a182 100755 --- a/jjb/onap/push-upstream-jobs.sh +++ b/jjb/onap/push-upstream-jobs.sh @@ -1,8 +1,8 @@ #!/bin/bash -# ============LICENSE_START======================================================= +# ============LICENSE_START==================================================== # Copyright (C) 2019 The Nordix Foundation. All rights reserved. -# ================================================================================ +# ============================================================================= # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -16,61 +16,58 @@ # limitations under the License. # # SPDX-License-Identifier: Apache-2.0 -# ============LICENSE_END========================================================= - +# ============LICENSE_END====================================================== # -# This script will take the changes that are pushed to Nordix Gerrit and push upstream to ONAP +# This script will take the single commit form the given Nordix Gerrit review +# and push it, and all its ancestor commit till $GERRIT_BRANCH, to ONAP Gerrit. # Pre-requisites for script to run successfully: -# - Author name in Nordix Gerrit equals LFID i.e. need to run "git config --global user.name " -# - infra public key on build server needs to be added to your users SSH Public Keys in ONAP Gerrit +# - Author name in Nordix Gerrit equals LFID +# i.e. need to run "git config --global user.name " +# - infra public key on build server needs to be added to your users SSH +# Public Keys in ONAP Gerrit # -set -o nounset -set -o pipefail +set -euxo pipefail -cd $WORKSPACE -echo "Retrieving information from commit to push towards ONAP" -project=$(git config --local remote.origin.url | awk -F "29418/onap/" '{print $2}') -message=$(git show -s --pretty=%B | grep -vi 'Signed-off-by') -username=$(git show -s --pretty=%an) +cd "$WORKSPACE" -pattern=" " -if [[ "$username" =~ $pattern ]] -then - echo "Incorrect username, use Linux Foundation ID as git user.name when pushing to Nordix" - exit 1 -fi +onap_gerrit_base='gerrit.onap.org:29418' +echo >&2 "Collecting information about what and how to push towards ONAP" -echo "Setting user name and email" -git config user.email $(git show -s --pretty=%ae) -git config user.name $username +# The git hash of the commit in the review this job runs on +commit_hash="$GERRIT_PATCHSET_REVISION" -echo "Checking out branch on master with new changes" -git reset HEAD~1 --soft -git checkout -b delivery_branch origin/$BRANCH +# GERRIT_PROJECT is in the form of onap/ +onap_project=$(echo "$GERRIT_PROJECT" | cut -d/ -f2- ) + +# Unfortunately for the some ONAP users, the Nordix Gerrit username don't match +# the ONAP Gerrit username as the old script use the git author name as +# the user which will push the change to ONAP Gerrit. +username=$(git show -s --pretty=%an) -git config --get remote.upstream.url -retVal=$? +onap_remote_url="ssh://$username@$onap_gerrit_base/$onap_project" -if [[ $retVal -eq 0 ]] -then - git remote rm upstream - git remote add upstream "ssh://$username@gerrit.onap.org:29418/$project.git" +# 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 when the topic +# is set for the change. +if [ -z "${GERRIT_TOPIC:-}" ] ; then + refspec="$commit_hash:refs/for/$GERRIT_BRANCH" else - git remote add upstream "ssh://$username@gerrit.onap.org:29418/$project.git" + refspec="$commit_hash:refs/for/$GERRIT_BRANCH/$GERRIT_TOPIC" fi -echo "Committing changes and pushing upstream" -git commit -as -m "$message" -git push upstream HEAD:refs/for/$BRANCH +echo >&2 "Pushing to ONAP" -retVal1=$? -if [[ $retVal1 -eq 0 ]] -then - echo "Push upstream to ONAP succeeded" -else - echo "Push upstream to ONAP failed" - exit 2 -fi +# do not fail if git push fails as in case of no new changes we want to succeed. See below. +set +o pipefail -git checkout $BRANCH -git branch -D delivery_branch +git push "$onap_remote_url" "$refspec" 2>&1 | tee push_result.txt +push_result=${PIPESTATUS[0]} + +# make the job a success if the above git push fails due to no new changes are needed +# to be created upstream. This will be useful when we switch to automatic triggering +# of the push-upstream for each patch set and jobs on different commits in a same chain +# will race with each other to push parts of the chain +if [ $push_result -ne 0 ]; then + grep '(no new changes)' push_result.txt +fi diff --git a/jjb/onap/rebase-jobs.sh b/jjb/onap/rebase-jobs.sh new file mode 100755 index 00000000..e888d43e --- /dev/null +++ b/jjb/onap/rebase-jobs.sh @@ -0,0 +1,40 @@ +#!/bin/bash +set -o errexit +set -o nounset +set -o pipefail + +cd $WORKSPACE +# Make sure the Nordix is set from Jenkins Job configuration +# parameter: NORDIX_REMOTE and not from previous job execution +if git remote | grep nordix > /dev/null ; then + git remote rm nordix +fi +# When the GERRIT_BRANCH is not set the rebase job wasn't triggered by merge +# but it's executed as part of timer. In this case we will make sure that all +# branches from remote are synced with Nordix Gerrit. +if [[ -z "${GERRIT_BRANCH:-}" ]] ; then + echo "-- Fetch all branches from ONAP for project: ${PROJECT} --" + REMOTE_BRANCHES=$(git branch -r | grep -v 'HEAD -> ' | awk '/origin/ {gsub("origin/","");print}') + for branch in ${REMOTE_BRANCHES} ; do + git branch -f --track ${branch} origin/${branch} + done +# The job was triggered by merge on ONAP Gerrit. We will make sure that branch set +# in GERRIT_BRANCH is in sync with Nordix Gerrit. +else + echo "-- Fetch branch: ${GERRIT_BRANCH} from ONAP for project: ${PROJECT} --" + REMOTE_BRANCHES=${GERRIT_BRANCH} + git branch -f --track ${GERRIT_BRANCH} origin/${GERRIT_BRANCH} +fi +git fetch origin -v +echo "-- Adding new remote $NORDIX_REMOTE for sync --" +git remote add nordix $NORDIX_REMOTE +git remote -v +echo "-- Merging changes from ONAP remote branches to local branch: --" +for branch in ${REMOTE_BRANCHES} ; do + echo "------ Branch name: ${branch}" + git checkout ${branch} -q + git merge origin/${branch} --ff-only --stat +done +echo "-- Pushing changes to Nordix Gerrit --" +git push nordix --all -v +echo "--------------------------------------------------------------------" diff --git a/jjb/onap/sdc-jtosca/sdcjtosca-push-upstream-jobs.yaml b/jjb/onap/sdc-jtosca/sdcjtosca-push-upstream-jobs.yaml index 9cb95251..d9f36e50 100644 --- a/jjb/onap/sdc-jtosca/sdcjtosca-push-upstream-jobs.yaml +++ b/jjb/onap/sdc-jtosca/sdcjtosca-push-upstream-jobs.yaml @@ -23,11 +23,6 @@ name: sdc-jtosca-push-upstream project: sdc/jtosca project-name: sdc-jtosca - stream: - - master: - branch: '{stream}' - - dublin: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/sdc-jtosca/sdcjtosca-rebase-jobs.yaml b/jjb/onap/sdc-jtosca/sdcjtosca-rebase-jobs.yaml index 6bb33332..7fec65eb 100644 --- a/jjb/onap/sdc-jtosca/sdcjtosca-rebase-jobs.yaml +++ b/jjb/onap/sdc-jtosca/sdcjtosca-rebase-jobs.yaml @@ -25,11 +25,5 @@ project: sdc/jtosca project-name: sdc-jtosca - stream: - - master: - branch: '{stream}' - - dublin: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/sdc/sdc-push-upstream-jobs.yaml b/jjb/onap/sdc/sdc-push-upstream-jobs.yaml index 6fda29fe..46b0dd3a 100644 --- a/jjb/onap/sdc/sdc-push-upstream-jobs.yaml +++ b/jjb/onap/sdc/sdc-push-upstream-jobs.yaml @@ -23,11 +23,6 @@ name: sdc-push-upstream project: sdc project-name: sdc - stream: - - master: - branch: '{stream}' - - dublin: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/sdc/sdc-rebase-jobs.yaml b/jjb/onap/sdc/sdc-rebase-jobs.yaml index 46c9a625..d58576c1 100644 --- a/jjb/onap/sdc/sdc-rebase-jobs.yaml +++ b/jjb/onap/sdc/sdc-rebase-jobs.yaml @@ -25,11 +25,5 @@ project: sdc project-name: sdc - stream: - - master: - branch: '{stream}' - - dublin: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/sdnc-oam/sdnc-oam-push-upstream.yaml b/jjb/onap/sdnc-oam/sdnc-oam-push-upstream.yaml index f40bce71..33e6aef2 100644 --- a/jjb/onap/sdnc-oam/sdnc-oam-push-upstream.yaml +++ b/jjb/onap/sdnc-oam/sdnc-oam-push-upstream.yaml @@ -23,11 +23,6 @@ name: sdnc-oam-push-upstream project: sdnc/oam project-name: sdnc-oam - stream: - - master: - branch: '{stream}' - - dublin: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/sdnc-oam/sdnc-oam-rebase.yaml b/jjb/onap/sdnc-oam/sdnc-oam-rebase.yaml index 12ea1af5..ac7d63c5 100644 --- a/jjb/onap/sdnc-oam/sdnc-oam-rebase.yaml +++ b/jjb/onap/sdnc-oam/sdnc-oam-rebase.yaml @@ -24,11 +24,6 @@ name: sdnc-oam-rebase project: sdnc/oam project-name: sdnc-oam - stream: - - master: - branch: '{stream}' - - dublin: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/so-docker-config/so-docker-config-push-upstream-jobs.yaml b/jjb/onap/so-docker-config/so-docker-config-push-upstream-jobs.yaml index c3bfc126..21839fc9 100644 --- a/jjb/onap/so-docker-config/so-docker-config-push-upstream-jobs.yaml +++ b/jjb/onap/so-docker-config/so-docker-config-push-upstream-jobs.yaml @@ -23,11 +23,5 @@ project: so/docker-config project-name: so-docker-config - stream: - - master: - branch: '{stream}' - - dublin: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/so-docker-config/so-docker-config-rebase-jobs.yaml b/jjb/onap/so-docker-config/so-docker-config-rebase-jobs.yaml index 55b22a8c..0de0c2f7 100644 --- a/jjb/onap/so-docker-config/so-docker-config-rebase-jobs.yaml +++ b/jjb/onap/so-docker-config/so-docker-config-rebase-jobs.yaml @@ -24,11 +24,6 @@ name: so-docker-config-rebase project: so/docker-config project-name: so-docker-config - stream: - - master: - branch: '{stream}' - - dublin: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-rebase' \ No newline at end of file + - 'onap-{project-name}-rebase' \ No newline at end of file diff --git a/jjb/onap/so/so-push-upstream-jobs.yaml b/jjb/onap/so/so-push-upstream-jobs.yaml index ffebb560..b5ff92eb 100644 --- a/jjb/onap/so/so-push-upstream-jobs.yaml +++ b/jjb/onap/so/so-push-upstream-jobs.yaml @@ -23,13 +23,5 @@ project: so project-name: so - stream: - - master: - branch: '{stream}' - - casablanca: - branch: '{stream}' - - dublin: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/so/so-rebase-jobs.yaml b/jjb/onap/so/so-rebase-jobs.yaml index 2d4601df..197603ba 100644 --- a/jjb/onap/so/so-rebase-jobs.yaml +++ b/jjb/onap/so/so-rebase-jobs.yaml @@ -24,13 +24,6 @@ name: so-rebase project: so project-name: so - stream: - - master: - branch: '{stream}' - - casablanca: - branch: '{stream}' - - dublin: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/testsuite-oom/testsuite_oom-push-upstream-jobs.yaml b/jjb/onap/testsuite-oom/testsuite_oom-push-upstream-jobs.yaml index 9fdabb47..68a29b3d 100644 --- a/jjb/onap/testsuite-oom/testsuite_oom-push-upstream-jobs.yaml +++ b/jjb/onap/testsuite-oom/testsuite_oom-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: testsuite_oom-push-upstream project: testsuite/oom project-name: testsuite_oom - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/testsuite-oom/testsuite_oom-rebase-jobs.yaml b/jjb/onap/testsuite-oom/testsuite_oom-rebase-jobs.yaml index 9fcac15f..ccf41260 100644 --- a/jjb/onap/testsuite-oom/testsuite_oom-rebase-jobs.yaml +++ b/jjb/onap/testsuite-oom/testsuite_oom-rebase-jobs.yaml @@ -25,9 +25,5 @@ project: testsuite/oom project-name: testsuite_oom - stream: - - master: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/testsuite/testsuite-push-upstream-jobs.yaml b/jjb/onap/testsuite/testsuite-push-upstream-jobs.yaml index b6532ce7..9280ed58 100644 --- a/jjb/onap/testsuite/testsuite-push-upstream-jobs.yaml +++ b/jjb/onap/testsuite/testsuite-push-upstream-jobs.yaml @@ -23,9 +23,6 @@ name: testsuite-push-upstream project: testsuite project-name: testsuite - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/testsuite/testsuite-rebase-jobs.yaml b/jjb/onap/testsuite/testsuite-rebase-jobs.yaml index 12238219..2dabc313 100644 --- a/jjb/onap/testsuite/testsuite-rebase-jobs.yaml +++ b/jjb/onap/testsuite/testsuite-rebase-jobs.yaml @@ -25,9 +25,5 @@ project: testsuite project-name: testsuite - stream: - - master: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/onap/vid/vid-push-upstream-jobs.yaml b/jjb/onap/vid/vid-push-upstream-jobs.yaml index 399ece95..9ffe7645 100644 --- a/jjb/onap/vid/vid-push-upstream-jobs.yaml +++ b/jjb/onap/vid/vid-push-upstream-jobs.yaml @@ -22,9 +22,6 @@ name: vid-push-upstream project: vid project-name: vid - stream: - - master: - branch: '{stream}' jobs: - - 'onap-{project-name}-{stream}-push-upstream' + - 'onap-{project-name}-push-upstream' diff --git a/jjb/onap/vid/vid-rebase-jobs.yaml b/jjb/onap/vid/vid-rebase-jobs.yaml index e0ae6392..cc3b4e51 100644 --- a/jjb/onap/vid/vid-rebase-jobs.yaml +++ b/jjb/onap/vid/vid-rebase-jobs.yaml @@ -24,9 +24,5 @@ project: vid project-name: vid - stream: - - master: - branch: '{stream}' - jobs: - - 'onap-{project-name}-{stream}-rebase' + - 'onap-{project-name}-rebase' diff --git a/jjb/opendev/openstack-heat-tempest-plugin/openstack-heat-tempest-plugin-push-upstream-jobs.yml b/jjb/opendev/openstack-heat-tempest-plugin/openstack-heat-tempest-plugin-push-upstream-jobs.yml new file mode 100644 index 00000000..ea1b0455 --- /dev/null +++ b/jjb/opendev/openstack-heat-tempest-plugin/openstack-heat-tempest-plugin-push-upstream-jobs.yml @@ -0,0 +1,26 @@ +--- +# ============LICENSE_START======================================================= +# Copyright (C) 2019 Nordix Foundation. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= +# +- project: + name: openstack-heat-tempest-plugin-push-upstream + project: openstack/heat-tempest-plugin + project-name: openstack-heat-tempest-plugin + + jobs: + - 'opendev-{project-name}-push-upstream' \ No newline at end of file diff --git a/jjb/opendev/openstack-heat-tempest-plugin/openstack-heat-tempest-plugin-rebase-jobs.yml b/jjb/opendev/openstack-heat-tempest-plugin/openstack-heat-tempest-plugin-rebase-jobs.yml new file mode 100644 index 00000000..82d6e367 --- /dev/null +++ b/jjb/opendev/openstack-heat-tempest-plugin/openstack-heat-tempest-plugin-rebase-jobs.yml @@ -0,0 +1,26 @@ +--- +# ============LICENSE_START======================================================= +# Copyright (C) 2019 Nordix Foundation. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= +# +- project: + name: openstack-heat-tempest-plugin-rebase + project: openstack/heat-tempest-plugin + project-name: openstack-heat-tempest-plugin + + jobs: + - 'opendev-{project-name}-rebase' \ No newline at end of file