blob: ecc7a282e7588228ebb98236ac42851967a8d1e7 [file] [log] [blame]
James E. King IIIf34b50f2019-07-15 07:04:28 -04001#! /bin/bash
2#
3# This script allows you to run coverity on the project and submit the
4# results. Do this inside the docker build container. Only works if
5# you are a coverity scan thrift project admin with access to the
6# necessary security token.
7#
8# Environment Variables
9#
10# COVERITY_SCAN_NOTIFICATION_EMAIL - email address to notify
11# COVERITY_SCAN_TOKEN - the Coverity Scan token (should be secure)
12# VERSION - the version to report we scanned
13
14set -ex
15
16wget -nv https://entrust.com/root-certificates/entrust_l1k.cer -O /tmp/scanca.cer
17
18pushd /tmp
19if [[ "$1" != "--skipdownload" ]]; then
20 rm -rf coverity_tool.tgz cov-analysis*
21 wget -nv -O coverity_tool.tgz https://scan.coverity.com/download/cxx/linux64 --post-data "project=thrift&token=$COVERITY_SCAN_TOKEN"
22 tar xzf coverity_tool.tgz
23fi
24COVBIN=$(echo $(pwd)/cov-analysis*/bin)
25export PATH=$COVBIN:$PATH
26popd
27
28./bootstrap.sh
29./configure $*
30rm -rf cov-int/
31cov-build --dir cov-int make check -j3
32tail -50 cov-int/build-log.txt
33tar cJf cov-int.tar.xz cov-int/
34curl --cacert /tmp/scanca.cer \
35 --form token="$COVERITY_SCAN_TOKEN" \
36 --form email="$COVERITY_SCAN_NOTIFICATION_EMAIL" \
37 --form file=@cov-int.tar.xz \
38 --form version="$VERSION" \
39 --form description="thrift master" \
40 https://scan.coverity.com/builds?project=thrift