summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_html_rsync_remote_results.sh
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2016-07-24 23:40:09 +0200
committerHolger Levsen <holger@layer-acht.org>2016-07-24 17:42:09 -0400
commite9bf11fe6952fa6fb8419b312e039963e3a5bcb4 (patch)
tree7a00e6894c93945c82c2200088e47a77dc431228 /bin/reproducible_html_rsync_remote_results.sh
parent8adab9bb7f5cbb80a655443a37ee7d3390f2a877 (diff)
downloadjenkins.debian.net-e9bf11fe6952fa6fb8419b312e039963e3a5bcb4.tar.xz
reproducible_html_rsync_remote_results: check the existence of the old directory before moving
fails on lede because there isn't any lede directory before Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'bin/reproducible_html_rsync_remote_results.sh')
-rwxr-xr-xbin/reproducible_html_rsync_remote_results.sh16
1 files changed, 9 insertions, 7 deletions
diff --git a/bin/reproducible_html_rsync_remote_results.sh b/bin/reproducible_html_rsync_remote_results.sh
index d459f58b..f19b92cd 100755
--- a/bin/reproducible_html_rsync_remote_results.sh
+++ b/bin/reproducible_html_rsync_remote_results.sh
@@ -19,15 +19,17 @@ rsync_remote_results() {
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
- 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
+ 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
- # delete the old results
- rm ${RESULTS}.tmp -r
echo "$(date -u) - $REPRODUCIBLE_URL/$PROJECT has been updated."
done
}