X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fjjb-deploy-job.sh;h=5efb9f48ec2905f418ea4d4466582da488f49699;hb=0d623ea91ba7dab654e7c9026b10f25f6786ff43;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..5efb9f48 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,5 @@ if [ -z "${JOB_NAME//\*/}" ]; then exit 1 fi -jenkins-jobs update --jobs-only --recursive --workers 4 jjb/ "$JOB_NAME" +echo "Deploying Job $JOB_NAME to sandbox" +jenkins-jobs -s sandbox update --jobs-only --recursive --workers 4 jjb/ "$JOB_NAME"