From: Marjan Schiller Date: Tue, 11 Jun 2013 09:14:34 +0000 (+0200) Subject: Added script to set the liveboot without copy the image. X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=bc5b76001979b779a284ce755ce8ea01f39e4d08;p=profitbricks%2Fjenkins-build-scripts.git Added script to set the liveboot without copy the image. --- diff --git a/liveboot_set_image.sh b/liveboot_set_image.sh new file mode 100755 index 0000000..31d243d --- /dev/null +++ b/liveboot_set_image.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# copyright 2012-2013 Marjan Schiller +# GPL2 licenced + +set -e +#set -x +export +echo + +# +# check if we have a LIVEBOOT_BUILD_NUMBER +# +if [ "$LIVEBOOT_BUILD_NUMBER" != "" ] ; then + echo "Ok, got LIVEBOOT_BUILD_NUMBER=$LIVEBOOT_BUILD_NUMBER, which is valid." +else + echo "Fail, no LIVEBOOT_BUILD_NUMBER set." + exit 1 +fi + +# +# check if there is an image for it +# +if [ -d /srv/mirror/liveboot/liveboot-????????-${LIVEBOOT_BUILD_NUMBER}/ ] ; then + SOURCE_DIR=$(ls -d /srv/mirror/liveboot/liveboot-????????-${LIVEBOOT_BUILD_NUMBER}/) + echo "Ok, found directory $SOURCE_DIR" +else + figlet "Failure:" + echo "/srv/mirror/liveboot/liveboot-????????-${LIVEBOOT_BUILD_NUMBER}/ does not exist." + exit 1 +fi + +# +# create pending-approval link and rsync again +# +cd /srv/mirror/liveboot +rm -f pending-approval +ln -sfv $(basename $SOURCE_DIR) pending-approval +echo "pending-approval link created, pointing to $SOURCE_DIR" + +# +# finish +# +figlet Ok +