~rcr/rirc

ref: e4febc193b633dd360d3d96ece9f5680c21eba8f rirc/scripts/sa_coverity_run.sh -rwxr-xr-x 667 bytes
e4febc19 — Richard Robbins Merge branch 'dev' into static_analysis 1 year, 8 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash

set -e

fail() { >&2 printf "%s\n" "$*"; exit 1; }

if [[ -z $1 ]]; then
	fail "Usage: '$0 dir'"
fi

if [[ -z "${COVERITY_EMAIL}" ]]; then
	fail "missing env COVERITY_EMAIL"
fi

if [[ -z "${COVERITY_TOKEN}" ]]; then
	fail "missing env COVERITY_TOKEN"
fi

COVERITY_OUT="cov-int"
COVERITY_TAR="cov-int.tgz"

VERSION=$(git rev-parse --short HEAD)

PATH=$(pwd)/$1/bin:$PATH cov-build --dir "$COVERITY_OUT" make clean all check

tar czf "$COVERITY_TAR" "$COVERITY_OUT"

curl \
	--form file=@"$COVERITY_TAR" \
	--form email="$COVERITY_EMAIL" \
	--form token="$COVERITY_TOKEN" \
	--form version="$VERSION" \
	https://scan.coverity.com/builds?project=rcr%2Frirc