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
Update lf-docker-get-container-tag
[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
..
5efb9f4
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,5
@@
if [ -z "${JOB_NAME//\*/}" ]; then
exit 1
fi
exit 1
fi
-jenkins-jobs update --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"