]> arthur.barton.de Git - netdata.git/blob - coverity-scan.sh
rename chart fields to avoid conflicts with backends; fixes #1962
[netdata.git] / coverity-scan.sh
1 #/bin/bash
2
3 token=
4 [ -f .coverity-token ] && token="$(<.coverity-token)"
5 [ -z "${token}" ] && \
6         echo >&2 "Save the coverity token to .coverity-token" && \
7         exit 1
8
9 echo >&2 "Coverity token: ${token}"
10
11 covbuild="$(which cov-build 2>/dev/null || command -v cov-build 2>/dev/null)"
12 [ -z "${covbuild}" -a -f .coverity-build ] && covbuild="$(<.coverity-build)"
13 [ -z "${covbuild}" ] && \
14         echo "Save command the full filename of cov-build in .coverity-build" && \
15         exit 1
16
17 [ ! -x "${covbuild}" ] && \
18         echo "The command ${covbuild} is not executable. Save command the full filename of cov-build in .coverity-build" && \
19         exit 1
20
21 echo >&2 "Cleaning up old builds..."
22 make clean || exit 1
23
24 [ -d "cov-int" ] && \
25         rm -rf "cov-int"
26
27 [ -f netdata-coverity-analysis.tgz ] && \
28         rm netdata-coverity-analysis.tgz
29
30 "${covbuild}" --dir cov-int make -j4 || exit 1
31
32 tar czvf netdata-coverity-analysis.tgz cov-int || exit 1
33
34 curl --form token="${token}" \
35   --form email=costa@tsaousis.gr \
36   --form file=@netdata-coverity-analysis.tgz \
37   --form version="1.6.0rc1" \
38   --form description="Description" \
39   https://scan.coverity.com/builds?project=firehol%2Fnetdata