From 032dbbae86190f6e7937db103513eb5dff6bb95d Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Sun, 11 Jun 2017 20:37:00 -0400 Subject: [PATCH] Improve error detection for when SSL invalid If SSL cert is invalid we don't even reach the Nexus server. So add code to check that status is 201 before proceeding. Change-Id: Ic5c8a0ce4177f73e6f753001ee8bbc5fdf02956c Signed-off-by: Thanh Ha --- shell/deploy | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shell/deploy b/shell/deploy index 20dc09bc..ac987e0c 100755 --- a/shell/deploy +++ b/shell/deploy @@ -317,7 +317,7 @@ EOF local resp local status - resp=$(curl -s -w "%{http_code}" --netrc -X POST -d "@$FILE_XML" \ + resp=$(curl -s -w " %{http_code}" --netrc -X POST -d "@$FILE_XML" \ -H "Content-Type:application/xml" \ "${nexus_url}/service/local/staging/profiles/${staging_profile_id}/start") status=$(echo "$resp" | awk 'END {print $NF}') @@ -327,6 +327,9 @@ EOF msg=$(sed -n -e 's/.*\(.*\)<\/msg>.*/\1/p' <<< $resp) echo "ERROR: $msg" exit "$status" + elif [ "$status" != "201" ]; then + echo "ERROR: Failed with status code $status" + exit "$status" fi local staging_repo_id -- 2.16.6