dump server log when failed
authorHuaxu Wan <huaxu.wan@intel.com>
Fri, 2 Dec 2011 07:32:04 +0000 (15:32 +0800)
committerHuaxu Wan <huaxu.wan@intel.com>
Fri, 2 Dec 2011 07:32:04 +0000 (15:32 +0800)
data/build.sh

index 57d1b8f..df2ce5e 100644 (file)
@@ -98,8 +98,7 @@ do
     if [ -n "$status" ]; then
         break
     fi
-    
-    sleep 1
+
     if [ -n "$verbose" ]; then
         length=`curl -s -u$user:$passwd "$HUDSON_SERVER/rest/projects/build/$build_id/console/" | cut -d ',' -f2|cut -d ':' -f2`
         curl -s -u$user:$passwd "$HUDSON_SERVER/rest/projects/build/$build_id/console/content" -d 'length'=$length -d 'offset'=$offset -G
@@ -107,6 +106,7 @@ do
     else
         echo -n '.'
     fi
+    sleep 1
 
 done
 echo ""
@@ -114,6 +114,7 @@ echo ""
 result=`echo $result_json|python -mjson.tool |grep result|cut -d '"' -f4`
 
 if [  x$result != xSUCCESS ]; then
+    curl -u$user:$passwd "$HUDSON_SERVER/job/build/$build_id/consoleText" -G
     die 'Remote Server Exception'
 else
     echo "Your local changes has been submitted to build server."