Fix jjb update script to handle when template changes have been made 85/13285/1
authorThanh Ha <thanh.ha@linuxfoundation.org>
Mon, 1 Dec 2014 19:30:24 +0000 (14:30 -0500)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Mon, 1 Dec 2014 19:30:24 +0000 (14:30 -0500)
Change-Id: I88a2f86f04dd2026be266d792ddb194cd1426e61
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
jjb/include-raw-jjb-update.sh

index e16f1db0dce18d50759955eb82bb2cf22c1c1cdb..517a48a9a4f708ba7e021e946e1b26fc83650179 100644 (file)
@@ -2,7 +2,11 @@ source /opt/virtualenv/jenkins-job-builder/bin/activate
 jenkins-jobs update jjb/
 
 # Submit patches for any jobs that can be auto updated
+function submitJJB {
+    git commit -asm "Update automated project templates"
+    git push origin HEAD:refs/for/master
+}
+
 gitdir=$(git rev-parse --git-dir); scp -p -P 29418 jenkins-releng@git.opendaylight.org:hooks/commit-msg ${gitdir}/hooks/
 python scripts/jjb-autoupdate-project.py
-git commit -asm "Update automated project templates"
-git push origin HEAD:refs/for/master
+git diff --quiet --exit-code || submitJJB