move coverity scan to a script, so that it doesn't run for every job

pull/207/head
David Schweikert 4 years ago
parent 5a6a61cb32
commit aeea60a0e0

@ -26,13 +26,6 @@ addons:
packages: packages:
- libcap2-bin - libcap2-bin
- libtest-command-perl - libtest-command-perl
coverity_scan:
project:
name: "schweikert/fping"
description: "Build submitted via Travis CI"
notification_email: david@schweikert.ch
build_command: "ci/build-3-compile.sh"
branch_pattern: coverity_scan
script: script:
- ci/build-4-compile.sh - ci/build-4-compile.sh
@ -43,6 +36,7 @@ stages:
- test - test
- name: deploy - name: deploy
if: branch = master OR branch = v4.x if: branch = master OR branch = v4.x
- name: coverity
jobs: jobs:
include: include:
@ -88,3 +82,11 @@ jobs:
dist: xenial dist: xenial
after_success: after_success:
- ci/deploy-bintray.sh - ci/deploy-bintray.sh
#### STAGE: coverity
- stage: coverity
name: coverity
os: linux
dist: xenial
script:
- ci/deploy-coverity.sh

@ -0,0 +1,25 @@
#!/bin/sh
set -e
COVERITY_SCAN_PROJECT_NAME=schweikert/fping
COVERITY_SCAN_EMAIL=david@schweikert.ch
if [ -z "$COVERITY_SCAN_TOKEN" ]; then
echo "ERROR: COVERITY_SCAN_TOKEN not defined." >&2
exit 1
fi
curl -o /tmp/cov-analysis-linux64.tgz https://scan.coverity.com/download/linux64 \
--form project=$COVERITY_SCAN_PROJECT_NAME --form token=$COVERITY_SCAN_TOKEN
tar xfz /tmp/cov-analysis-linux64.tgz
./autogen.sh
./configure --enable-ipv4 --enable-ipv6 --enable-safe-limits --prefix=/opt/fping
cov-analysis-linux64-*/bin/cov-build --dir cov-int make -j4
tar cfz cov-int.tar.gz cov-int
curl https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME \
--form token=$COVERITY_SCAN_TOKEN \
--form email=$COVERITY_SCAN_EMAIL \
--form file=@cov-int.tar.gz \
--form version="`git rev-parse --short HEAD`" \
--form description="`git rev-parse --short HEAD` / $TRAVIS_BUILD_ID "
Loading…
Cancel
Save