summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--azure-pipelines/coverity.yml36
-rw-r--r--azure-pipelines/nightly.yml19
-rwxr-xr-xci/coverity-build.sh (renamed from ci/coverity.sh)24
-rwxr-xr-xci/coverity-publish.sh33
4 files changed, 69 insertions, 43 deletions
diff --git a/azure-pipelines/coverity.yml b/azure-pipelines/coverity.yml
new file mode 100644
index 000000000..d8d34229e
--- /dev/null
+++ b/azure-pipelines/coverity.yml
@@ -0,0 +1,36 @@
+resources:
+- repo: self
+
+jobs:
+- job: coverity
+ displayName: 'Coverity'
+ pool:
+ vmImage: 'Ubuntu 16.04'
+ steps:
+ - task: Docker@0
+ displayName: Build
+ inputs:
+ action: 'Run an image'
+ imageName: 'libgit2/trusty-openssl:latest'
+ volumes: |
+ $(Build.SourcesDirectory):/src
+ $(Build.BinariesDirectory):/build
+ envVars: |
+ COVERITY_TOKEN=$(COVERITY_TOKEN)
+ workDir: '/build'
+ containerCommand: '/src/ci/coverity-build.sh'
+ detached: false
+ - task: Docker@0
+ displayName: Publish
+ inputs:
+ action: 'Run an image'
+ imageName: 'libgit2/trusty-openssl:latest'
+ volumes: |
+ $(Build.SourcesDirectory):/src
+ $(Build.BinariesDirectory):/build
+ envVars: |
+ COVERITY_TOKEN=$(COVERITY_TOKEN)
+ workDir: '/build'
+ containerCommand: '/src/ci/coverity-publish.sh'
+ detached: false
+ continueOnError: true
diff --git a/azure-pipelines/nightly.yml b/azure-pipelines/nightly.yml
index de7da9677..1d34a14df 100644
--- a/azure-pipelines/nightly.yml
+++ b/azure-pipelines/nightly.yml
@@ -186,22 +186,3 @@ jobs:
CMAKE_OPTIONS=-DUSE_HTTPS=OpenSSL
RUN_INVASIVE_TESTS=true
SKIP_PROXY_TESTS=true
-
-- job: coverity
- displayName: 'Coverity'
- pool:
- vmImage: 'Ubuntu 16.04'
- steps:
- - task: Docker@0
- displayName: Build
- inputs:
- action: 'Run an image'
- imageName: 'libgit2/trusty-openssl:latest'
- volumes: |
- $(Build.SourcesDirectory):/src
- $(Build.BinariesDirectory):/build
- envVars: |
- COVERITY_TOKEN=$(COVERITY_TOKEN)
- workDir: '/build'
- containerCommand: '/src/ci/coverity.sh'
- detached: false
diff --git a/ci/coverity.sh b/ci/coverity-build.sh
index a97fae8c8..f8264fa83 100755
--- a/ci/coverity.sh
+++ b/ci/coverity-build.sh
@@ -39,27 +39,3 @@ COVERITY_UNSUPPORTED=1 \
$COV_BUILD --dir cov-int \
cmake --build .
-# Upload results
-tar czf libgit2.tgz cov-int
-SHA=$(cd ${SOURCE_DIR} && git rev-parse --short HEAD)
-
-HTML="$(curl \
- --silent \
- --write-out "\n%{http_code}" \
- --form token="$COVERITY_TOKEN" \
- --form email=libgit2@gmail.com \
- --form file=@libgit2.tgz \
- --form version="$SHA" \
- --form description="libgit2 build" \
- 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}" != "200" -a "${STATUS_CODE}" != "201" ]; then
- echo "Received error code ${STATUS_CODE} from Coverity"
- exit 1
-fi
diff --git a/ci/coverity-publish.sh b/ci/coverity-publish.sh
new file mode 100755
index 000000000..2341b13fb
--- /dev/null
+++ b/ci/coverity-publish.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+set -e
+
+# Results check
+[ ! -d "cov-int" ] && echo "Coverity directory not found" && exit 1
+
+# Upload results
+tar czf libgit2.tgz cov-int
+
+SOURCE_DIR=${SOURCE_DIR:-$( cd "$( dirname "${BASH_SOURCE[0]}" )" && dirname $( pwd ) )}
+SHA=$(cd ${SOURCE_DIR} && git rev-parse --short HEAD)
+
+HTML="$(curl \
+ --silent \
+ --write-out "\n%{http_code}" \
+ --form token="$COVERITY_TOKEN" \
+ --form email=libgit2@gmail.com \
+ --form file=@libgit2.tgz \
+ --form version="$SHA" \
+ --form description="libgit2 build" \
+ 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)"
+
+if [ "${STATUS_CODE}" != "200" -a "${STATUS_CODE}" != "201" ]; then
+ echo "Received error code ${STATUS_CODE} from Coverity"
+ exit 1
+fi