summaryrefslogtreecommitdiffstats
path: root/update_jdn.sh
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2016-06-20 23:34:55 +0200
committerHolger Levsen <holger@layer-acht.org>2016-06-20 23:34:55 +0200
commit1fecba09c8aef71c92653bb64b476478ac151a63 (patch)
tree5355eb5f7f3c7ddf9c33063937c4d3cce667ff3d /update_jdn.sh
parent22f3866df42d1085ef31e632187082f1a2ddc5f5 (diff)
downloadjenkins.debian.net-1fecba09c8aef71c92653bb64b476478ac151a63.tar.xz
improve update logic to only update jobs if configs have changed
Diffstat (limited to 'update_jdn.sh')
-rwxr-xr-xupdate_jdn.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/update_jdn.sh b/update_jdn.sh
index 5c0c8584..e11179c7 100755
--- a/update_jdn.sh
+++ b/update_jdn.sh
@@ -513,7 +513,13 @@ if [ "$HOSTNAME" = "jenkins" ] || [ "$HOSTNAME" = "jenkins-test-vm" ] ; then
done
rm -f $TMPFILE
for config in *.yaml ; do
- if [ $config -nt $STAMP ] || [ ! -f $STAMP ] ; then
+ # do update, if
+ # no stamp file exist or
+ # no .py file exists and config is newer than stamp or
+ # a .py file exists and .py file is newer than stamp
+ if [ ! -f $STAMP ] || \
+ ( [ ! -f $config.py ] && [ $config -nt $STAMP ] ) || \
+ ( [ -f $config.py ] && [ $config.py -nt $STAMP ] ) ; then
$JJB update $config
else
echo "$config has not changed, nothing to do."