]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
Added script to set the liveboot without copy the image.
authorMarjan Schiller <marjan.schiller@profitbricks.com>
Tue, 11 Jun 2013 09:14:34 +0000 (11:14 +0200)
committerMarjan Schiller <marjan.schiller@profitbricks.com>
Tue, 11 Jun 2013 09:14:34 +0000 (11:14 +0200)
liveboot_set_image.sh [new file with mode: 0755]

diff --git a/liveboot_set_image.sh b/liveboot_set_image.sh
new file mode 100755 (executable)
index 0000000..31d243d
--- /dev/null
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+# copyright 2012-2013 Marjan Schiller <marjan.schiller@profitbricks.com>
+# 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
+