blob: 88e08d3e60e88aed89c24d5e454d909ff6dee57e [file] [log] [blame]
Brian Silvermana8ce4c32018-08-04 23:57:09 -07001#! /bin/bash
2#
3# Copyright 2017 James E. King, III
4# Distributed under the Boost Software License, Version 1.0.
5# (See accompanying file LICENSE_1_0.txt or copy at
6# http://www.boost.org/LICENSE_1_0.txt)
7#
8# Bash script to run in travis to perform a Coverity Scan build
9#
10
11#
12# Environment Variables
13#
14# COVERITY_SCAN_NOTIFICATION_EMAIL - email address to notify
15# COVERITY_SCAN_TOKEN - the Coverity Scan token (should be secure)
16# SELF - the boost libs directory name
17
18set -ex
19
20pushd /tmp
21rm -rf coverity_tool.tgz cov-analysis*
22wget -nv https://scan.coverity.com/download/linux64 --post-data "token=$COVERITY_SCAN_TOKEN&project=boostorg/$SELF" -O coverity_tool.tgz
23tar xzf coverity_tool.tgz
24COVBIN=$(echo $(pwd)/cov-analysis*/bin)
25export PATH=$COVBIN:$PATH
26popd
27
28cd libs/$SELF/test
29../../../b2 toolset=gcc clean
30rm -rf cov-int/
31cov-build --dir cov-int ../../../b2 toolset=gcc -q -j3
32tar cJf cov-int.tar.xz cov-int/
33curl --form token="$COVERITY_SCAN_TOKEN" \
34 --form email="$COVERITY_SCAN_NOTIFICATION_EMAIL" \
35 --form file=@cov-int.tar.xz \
36 --form version="$(git describe --tags)" \
37 --form description="boostorg/$SELF" \
38 https://scan.coverity.com/builds?project="boostorg/$SELF"