From: Thanh Ha Date: Tue, 9 Jan 2018 21:38:32 +0000 (-0500) Subject: Improve debugging output for deploy nexus-zip cmd X-Git-Tag: v0.11.2~5 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=459dded53778ab22fa02d289e320c9cf1a1ca286;p=releng%2Flftools.git Improve debugging output for deploy nexus-zip cmd Print out the HTTP Status code as well as the http response from the server (if any, Nexus doesn't always return any) and the contents of the zip file on failure. Issue: RT-50048 Change-Id: I54014819d18c0090c45fd8378954dc9aa5e540f8 Signed-off-by: Thanh Ha --- diff --git a/shell/deploy b/shell/deploy index a983baa6..c664c36a 100755 --- a/shell/deploy +++ b/shell/deploy @@ -685,9 +685,17 @@ deploy_nexus_zip() { exit 1 fi - echo "Pushing $deploy_zip to $nexus_repo on $nexus_url" - curl --netrc --upload-file "$deploy_zip" \ - "${nexus_url}/service/local/repositories/${nexus_repo}/content-compressed/${nexus_path}" + echo "Pushing $deploy_zip to $nexus_repo on $nexus_url to path $nexus_path" + resp=$(curl -s -w "\\n\\n%{http_code}" --netrc --upload-file "$deploy_zip" \ + "${nexus_url}/service/local/repositories/${nexus_repo}/content-compressed/${nexus_path}") + status=$(echo "$resp" | awk 'END {print $NF}') + + echo "HTTP status: $status" + if [[ "$status" != "20"* ]]; then + echo "Failed with: $resp" + echo "Zip contains: $(unzip -l "$deploy_zip")" + exit "$status" + fi } upload_to_nexus() {