-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathsa_coverity_run.sh
More file actions
executable file
·47 lines (32 loc) · 911 Bytes
/
Copy pathsa_coverity_run.sh
File metadata and controls
executable file
·47 lines (32 loc) · 911 Bytes
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
set -e
set -u
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
DIR="$1"
COVERITY_OUT="cov-int"
COVERITY_TAR="cov-int.tgz"
VERSION=$(git rev-parse --short HEAD)
export PATH="$PWD/$DIR/bin:$PATH"
export CFLAGS="-pipe -O0"
export LDFLAGS="-pipe"
make -e -f Makefile.dev clean-dev clean-lib
make -e -f Makefile.dev libs
cov-build --dir "$COVERITY_OUT" make -e -f Makefile.dev rirc check
tar czf "$COVERITY_TAR" "$COVERITY_OUT"
curl https://scan.coverity.com/builds?project=rcr%2Frirc \
--form description="$VERSION" \
--form email="$COVERITY_EMAIL" \
--form file=@"$COVERITY_TAR" \
--form token="$COVERITY_TOKEN" \
--form version="$VERSION"
mv $COVERITY_OUT "$DIR"
mv $COVERITY_TAR "$DIR"