X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fjjb-deploy-job.sh;h=99ef3678e47e006b96c93a66eafb91afc7a9c7c8;hb=3fba00b0773a59eed76521103afb0a62deb79786;hp=771f17b4bd2cddbb3151b866fd4446502a4f170b;hpb=334d6e2906736244da93122c82e8beda632c6234;p=releng%2Fglobal-jjb.git diff --git a/shell/jjb-deploy-job.sh b/shell/jjb-deploy-job.sh index 771f17b4..99ef3678 100644 --- a/shell/jjb-deploy-job.sh +++ b/shell/jjb-deploy-job.sh @@ -19,8 +19,11 @@ set -e -o pipefail # shellcheck source=/tmp/v/jenkins-job-builder/bin/activate disable=SC1091 source "/tmp/v/jenkins-job-builder/bin/activate" -echo "-----> Fetching project" -git fetch origin "$GERRIT_REFSPEC" && git checkout FETCH_HEAD +# Fetch patch if gerrit project matches the jjb-deploy project +if [ "${GERRIT_PROJECT}" == "${PROJECT}" ]; then + echo "-----> Fetching ${PROJECT} patch" + git fetch origin "$GERRIT_REFSPEC" && git checkout FETCH_HEAD +fi # If not Gerrit Trigger than assume GitHub COMMENT="${GERRIT_EVENT_COMMENT_TEXT:-$ghprbCommentBody}" @@ -32,4 +35,4 @@ if [ -z "${JOB_NAME//\*/}" ]; then exit 1 fi -jenkins-jobs update --jobs-only --recursive --workers 4 jjb/ "$JOB_NAME" +jenkins-jobs -s sandbox update --jobs-only --recursive --workers 4 jjb/ "$JOB_NAME"