]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
fail early if not REQUEST_ID is given
authorHolger Levsen <holger@layer-acht.org>
Fri, 12 Oct 2012 10:52:08 +0000 (12:52 +0200)
committerHolger Levsen <holger@layer-acht.org>
Fri, 12 Oct 2012 10:52:08 +0000 (12:52 +0200)
liveboot2db.py
liveboot_build.sh

index cc5e93ecd309171c346e5e881b736aca56ef4640..936b94bd22f622b5f5cb22bae9bdd4714a0c692b 100755 (executable)
@@ -7,6 +7,7 @@ from db_add import *
 
 
 if __name__ == '__main__':
+    print len(sys.argv)
     if len(sys.argv) != 5 and len(sys.argv) !=6:
         # if the build was just started:
         print("usage: %s $job_name $build_number $liveboot_request_id $start_time")
index 24307ce6e695c695a71a0c7fc89706c554f6e623..ba5f47cc45b8c9edd4aae40edf9499ea090e9bde 100755 (executable)
@@ -7,7 +7,10 @@ set -e
 #set -x
 export
 
-SCRIPTSDIR=$(dirname $0)
+if [ "$REQUEST_ID" = "" ] ; then 
+       echo "REQUEST_ID must not be empty!"
+       exit 1
+fi
 
 #
 # Define default settings
@@ -28,6 +31,7 @@ RSYNC_DST4="liveboot@10.252.1.1/liveboot/"
 # dc1+2 (mgmt1)
 RSYNC_DST5="liveboot@10.1.1.1/liveboot/"
 
+SCRIPTSDIR=$(dirname $0)
 BUILD_SCRIPT=$(mktemp)
 cat > $BUILD_SCRIPT <<-EOF
 cd /srv/build