X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fjjb-deploy-job.sh;h=240c1faf4660dd855df50e2b8a90aaf3dbff4d15;hb=2a10c83b2d506008cc6c01c134515fb6328e1f3a;hp=3db95062d24ec15f000fd30ef862887f7202cec3;hpb=4e494e6bf70108968f052cd4ce1d8379fee04a43;p=releng%2Fglobal-jjb.git diff --git a/shell/jjb-deploy-job.sh b/shell/jjb-deploy-job.sh index 3db95062..240c1faf 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 --recursive --workers 4 jjb/ "$JOB_NAME" +jenkins-jobs update --jobs-only --recursive --workers 4 jjb/ "$JOB_NAME"