From: Holger Levsen Date: Fri, 12 Oct 2012 10:52:08 +0000 (+0200) Subject: fail early if not REQUEST_ID is given X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=ba512241066ec16ecc8b91583ea98847cff09874;p=profitbricks%2Fjenkins-build-scripts.git fail early if not REQUEST_ID is given --- diff --git a/liveboot2db.py b/liveboot2db.py index cc5e93e..936b94b 100755 --- a/liveboot2db.py +++ b/liveboot2db.py @@ -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") diff --git a/liveboot_build.sh b/liveboot_build.sh index 24307ce..ba5f47c 100755 --- a/liveboot_build.sh +++ b/liveboot_build.sh @@ -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