Code Review
/
releng
/
global-jjb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add submodule-timeout for submodule operations
[releng/global-jjb.git]
/
shell
/
jjb-deploy-job.sh
diff --git
a/shell/jjb-deploy-job.sh
b/shell/jjb-deploy-job.sh
index
3db9506
..
240c1fa
100644
(file)
--- 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"
# 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}"
# 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
exit 1
fi
-jenkins-jobs update --recursive --workers 4 jjb/ "$JOB_NAME"
+jenkins-jobs update --
jobs-only --
recursive --workers 4 jjb/ "$JOB_NAME"