laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ci/+/42820?usp=email )

Change subject: coverity/jenkins: check if upload was successful
......................................................................

coverity/jenkins: check if upload was successful

When the server returns an error, the curl command does not fail -
probably because the server sends a wrong http status code:

  curl \
   --form token="$token" \
   --form [email protected] --form [email protected] \
   --form version=Version --form description=AutoUpload \
   https://scan.coverity.com/builds?project=Osmocom
  + set +x
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  
Current
                                   Dload  Upload   Total   Spent    Left  Speed
  …
  <html>
  <head><title>413 Request Entity Too Large</title></head>
  <body>
  <center><h1>413 Request Entity Too Large</h1></center>
  <hr><center>nginx/1.19.10</center>
  </body>
  </html>
  Finished: SUCCESS

Fail if the output doesn't contain the "Build successfully submitted"
string, so the job fails if there was an error.

(The request entity too large error is probably an error on their end,
scan.coverity.com still says they are performing upgrades on their
servers.)

Change-Id: Ie63a33dfa7648b38f1f01cb8c87db76949f69e10
---
M coverity/jenkins.sh
1 file changed, 8 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  daniel: Looks good to me, approved
  laforge: Looks good to me, but someone else must approve




diff --git a/coverity/jenkins.sh b/coverity/jenkins.sh
index d19b93c..ca02f5f 100755
--- a/coverity/jenkins.sh
+++ b/coverity/jenkins.sh
@@ -40,4 +40,11 @@
   exit 1
 fi

-eval "$curl_cmd"
+eval "$curl_cmd" | tee output.html
+
+if ! grep -q "Build successfully submitted" output.html; then
+       set +x
+       echo
+       echo "ERROR: coverity upload has failed!"
+       exit 1
+fi

--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/42820?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Ie63a33dfa7648b38f1f01cb8c87db76949f69e10
Gerrit-Change-Number: 42820
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <[email protected]>
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: lynxis lazus <[email protected]>

Reply via email to