Verified Commit 3a4cc153 authored by Mattia Rizzolo's avatar Mattia Rizzolo
Browse files

Partially revert "update_jdn: simpler checks for up2date jenkins confs"

So there are some gotcha that I couldn't get before

This reverts commit 8647d21a

.

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent eb769e67
...@@ -674,16 +674,20 @@ if [ "$HOSTNAME" = "jenkins" ] || [ "$HOSTNAME" = "jenkins-test-vm" ] ; then ...@@ -674,16 +674,20 @@ if [ "$HOSTNAME" = "jenkins" ] || [ "$HOSTNAME" = "jenkins-test-vm" ] ; then
# #
cd /srv/jenkins/job-cfg cd /srv/jenkins/job-cfg
for metaconfig in *.yaml.py ; do for metaconfig in *.yaml.py ; do
# regen the file only if the .py is newer than the generated file TMPFILE=$(sudo -u jenkins-adm mktemp)
if [ ! -f "${metaconfig%.py}" ] || [ "$metaconfig" -nt "${metaconfig%.py}" ]; then sudo -u jenkins-adm tee "$TMPFILE" >/dev/null < ./$metaconfig
TMPFILE=$(sudo -u jenkins-adm mktemp) if ! sudo -u jenkins-adm cmp -s ${metaconfig%.py} "$TMPFILE" ; then
sudo -u jenkins-adm "./$metaconfig" > "$TMPFILE"
sudo -u jenkins-adm mv "$TMPFILE" "${metaconfig%.py}" sudo -u jenkins-adm mv "$TMPFILE" "${metaconfig%.py}"
fi fi
done done
for config in *.yaml ; do for config in *.yaml ; do
# do update, if no stamp file exist or config is newer than stamp # do update, if
if [ ! -f $STAMP ] || [ $config -nt $STAMP ] ; then # 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
echo "$config has changed, executing updates." echo "$config has changed, executing updates."
$JJB update $config $JJB update $config
fi fi
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment