]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
add checks if image exits
authorHolger Levsen <holger@layer-acht.org>
Thu, 8 Nov 2012 12:10:02 +0000 (13:10 +0100)
committerHolger Levsen <holger@layer-acht.org>
Thu, 8 Nov 2012 12:10:02 +0000 (13:10 +0100)
liveboot_testdeploy.sh

index 1b4cdb033add15fa7666935142d1d7fd7edc55b7..ee7c282847edcd8e73336e31bbf44f8ca998785a 100755 (executable)
@@ -8,22 +8,31 @@ set -x
 export
 
 if [ "$LIVEBOOT_ID" != "" ] ; then 
-       echo "Ok."
+       echo "Ok, got LIVEBOOT_ID=$LIVEBOOT_ID"
 else 
-       echo "Fail.a
+       echo "Fail, no LIVEBOOT_ID set.
        exit 1
 fi
 
+if [ -d /srv/mirror/liveboot/liveboot-????????-${LIVEBOOT_ID}/ ] ; then
+       SOURCE_DIR=$(ls -d /srv/mirror/liveboot/liveboot-????????-${LIVEBOOT_ID}/)
+else
+       echo "Fail, /srv/mirror/liveboot/liveboot-????????-${LIVEBOOT_ID}/ does not exist."
+       exit 1
+fi
+
+TESTSERVER=pserver2
+
 #ssh liveboot@riserver echo Ok
 
-ping -c 1 pserver2
+ping -c 1 $TESTSERVER
 cat /etc/jenkins/pserver2.ipmi | ipmitool -H 192.168.178.49  -U ADMIN -a chassis power reset
 
 sleep 2
-ping -c 1 pserver2 || true
+ping -c 1 $TESTSERVER || true
 
 sleep 60
-ping -c 1 pserver2
+ping -c 1 $TESTSERVER
 
 figlet "OK"