]> arthur.barton.de Git - netdata.git/blob - coverity-scan.sh
fail2bain plugin: "Currently In Jail" chart renamed
[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 version="$(cat config.h | grep "^#define PACKAGE_VERSION" | cut -d '"' -f 2)"
22 echo >&2 "Working on netdata version: ${version}"
23
24 echo >&2 "Cleaning up old builds..."
25 make clean || exit 1
26
27 [ -d "cov-int" ] && \
28         rm -rf "cov-int"
29
30 [ -f netdata-coverity-analysis.tgz ] && \
31         rm netdata-coverity-analysis.tgz
32
33 "${covbuild}" --dir cov-int make -j4 || exit 1
34
35 tar czvf netdata-coverity-analysis.tgz cov-int || exit 1
36
37 curl --form token="${token}" \
38   --form email=costa@tsaousis.gr \
39   --form file=@netdata-coverity-analysis.tgz \
40   --form version="${version}" \
41   --form description="netdata, real-time performance monitoring, done right." \
42   https://scan.coverity.com/builds?project=firehol%2Fnetdata