summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2017-04-30 15:38:48 +0200
committerHolger Levsen <holger@layer-acht.org>2017-04-30 15:38:48 +0200
commitd3129b584fe6f409dd73f38d581af613b1d0407f (patch)
tree3732a9c3b2a0ff9de5db98f8425b3435e53a49e3
parent0cda9604106056e0524079be899892a7a72f8373 (diff)
downloadjenkins.debian.net-d3129b584fe6f409dd73f38d581af613b1d0407f.tar.xz
reproducible lede/openwrt/coreboot/netbsd: dont fail if there is nothing to rsync
Signed-off-by: Holger Levsen <holger@layer-acht.org>
-rwxr-xr-xbin/reproducible_html_rsync_remote_results.sh33
1 files changed, 18 insertions, 15 deletions
diff --git a/bin/reproducible_html_rsync_remote_results.sh b/bin/reproducible_html_rsync_remote_results.sh
index f19b92cd..93127075 100755
--- a/bin/reproducible_html_rsync_remote_results.sh
+++ b/bin/reproducible_html_rsync_remote_results.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-# Copyright 2015 Holger Levsen <holger@layer-acht.org>
+# Copyright 2015-2017 Holger Levsen <holger@layer-acht.org>
# released under the GPLv=2
DEBUG=false
@@ -16,21 +16,24 @@ rsync_remote_results() {
echo "$(date -u) - Starting to rsync results for '$PROJECT'."
local RESULTS=$(mktemp --tmpdir=$TEMPDIR -d reproducible-rsync-XXXXXXXXX)
# copy the new results from build node to webserver node
- rsync -r -v -e "ssh -o 'Batchmode = yes'" profitbricks-build3-amd64.debian.net:$BASE/$PROJECT/ $RESULTS
- chmod 775 $RESULTS
- # move old results out of the way
- if [ -d $BASE/$PROJECT ] ; then
- mv $BASE/$PROJECT ${RESULTS}.tmp
- # preserve images and css
- for OBJECT in $(find ${RESULTS}.tmp -name "*css" -o -name "*png" -o -name "*jpg") ; do
- cp -v $OBJECT $RESULTS/
- done
- # delete the old results
- rm ${RESULTS}.tmp -r
+ if rsync -r -v -e "ssh -o 'Batchmode = yes'" profitbricks-build3-amd64.debian.net:$BASE/$PROJECT/ $RESULTS 2>/dev/null ; then
+ chmod 775 $RESULTS
+ # move old results out of the way
+ if [ -d $BASE/$PROJECT ] ; then
+ mv $BASE/$PROJECT ${RESULTS}.tmp
+ # preserve images and css
+ for OBJECT in $(find ${RESULTS}.tmp -name "*css" -o -name "*png" -o -name "*jpg") ; do
+ cp -v $OBJECT $RESULTS/
+ done
+ # delete the old results
+ rm ${RESULTS}.tmp -r
+ fi
+ # make the new results visible
+ mv $RESULTS $BASE/$PROJECT
+ echo "$(date -u) - $REPRODUCIBLE_URL/$PROJECT has been updated."
+ else
+ echo "$(date -u) - no new results for '$PROJECT' found."
fi
- # make the new results visible
- mv $RESULTS $BASE/$PROJECT
- echo "$(date -u) - $REPRODUCIBLE_URL/$PROJECT has been updated."
done
}