Author: heiko.braun(a)jboss.com
Date: 2007-05-31 08:12:02 -0400 (Thu, 31 May 2007)
New Revision: 3328
Added:
trunk/build/hudson/jboss/bin/http.sh
Log:
Check if the AS was successfully started
Added: trunk/build/hudson/jboss/bin/http.sh
===================================================================
--- trunk/build/hudson/jboss/bin/http.sh (rev 0)
+++ trunk/build/hudson/jboss/bin/http.sh 2007-05-31 12:12:02 UTC (rev 3328)
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+#
+# Simple helper that checks if an HTTP host is available.
+# (Relies on wget)
+#
+# Within hudson it can be used to test if the AS instance
+# has successfully booted.
+#
+# @author Heiko.Braun(a)jboss.com
+#
+
+SLEEP_TIME=10 # the actual sleep time in between test
+NUM_RETRIES=12 # equals 120 seconds before exit
+
+if [ "x$1" = "x" ]; then
+ echo "Usage: http.sh <hostname:port>"
+ exit 0
+fi
+
+COUNTER=0
+while [ $COUNTER -lt $NUM_RETRIES ]; do
+ if wget --spider $1 &> /dev/null; then
+ echo "'$1' is available"
+ exit 0
+ else
+ echo "'$1' does not respond, wait another $SLEEP_TIME seconds"
+ fi
+ sleep $SLEEP_TIME
+ let COUNTER=COUNTER+1
+done
+
+echo "Unable to connect to $1, exiting..."
+exit 1
+
+
Property changes on: trunk/build/hudson/jboss/bin/http.sh
___________________________________________________________________
Name: svn:executable
+ *
Show replies by date