X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fjjb-deploy-job.sh;h=240c1faf4660dd855df50e2b8a90aaf3dbff4d15;hb=2a10c83b2d506008cc6c01c134515fb6328e1f3a;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..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}"