From 1fecba09c8aef71c92653bb64b476478ac151a63 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Mon, 20 Jun 2016 23:34:55 +0200 Subject: improve update logic to only update jobs if configs have changed --- update_jdn.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'update_jdn.sh') 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." -- cgit v1.2.3-54-g00ecf