summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlosmn@github.com>2016-04-12 00:18:17 +0200
committerCarlos Martín Nieto <carlosmn@github.com>2016-04-12 00:18:17 +0200
commit211e117a0590583a720c53172406f34186c543bd (patch)
treef9df7f4049a0fbc67ce6d725d83e3bb0b4d79a1e /script
parent785d8c48ea8725691da3c50e7dae8751523d4c30 (diff)
parent8edadbf97889fbd80289a72209fdd485ddea3521 (diff)
downloadlibgit2-0.24.1.tar.gz
Merge pull request #3739 from ethomson/0.24.1v0.24.1
Backport bug fixes to 0.24
Diffstat (limited to 'script')
-rwxr-xr-xscript/coverity.sh18
1 files changed, 16 insertions, 2 deletions
diff --git a/script/coverity.sh b/script/coverity.sh
index 8c826892f..7fe9eb4c7 100755
--- a/script/coverity.sh
+++ b/script/coverity.sh
@@ -49,10 +49,24 @@ COVERITY_UNSUPPORTED=1 \
# Upload results
tar czf libgit2.tgz cov-int
SHA=$(git rev-parse --short HEAD)
-curl \
+
+HTML="$(curl \
+ --silent \
+ --write-out "\n%{http_code}" \
--form token="$COVERITY_TOKEN" \
--form email=bs@github.com \
--form file=@libgit2.tgz \
--form version="$SHA" \
--form description="Travis build" \
- https://scan.coverity.com/builds?project=libgit2
+ https://scan.coverity.com/builds?project=libgit2)"
+# Body is everything up to the last line
+BODY="$(echo "$HTML" | head -n-1)"
+# Status code is the last line
+STATUS_CODE="$(echo "$HTML" | tail -n1)"
+
+echo "${BODY}"
+
+if [ "${STATUS_CODE}" != "201" ]; then
+ echo "Received error code ${STATUS_CODE} from Coverity"
+ exit 1
+fi