Brian Silverman | a8ce4c3 | 2018-08-04 23:57:09 -0700 | [diff] [blame] | 1 | #! /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 | |
| 18 | set -ex |
| 19 | |
| 20 | pushd /tmp |
| 21 | rm -rf coverity_tool.tgz cov-analysis* |
| 22 | wget -nv https://scan.coverity.com/download/linux64 --post-data "token=$COVERITY_SCAN_TOKEN&project=boostorg/$SELF" -O coverity_tool.tgz |
| 23 | tar xzf coverity_tool.tgz |
| 24 | COVBIN=$(echo $(pwd)/cov-analysis*/bin) |
| 25 | export PATH=$COVBIN:$PATH |
| 26 | popd |
| 27 | |
| 28 | cd libs/$SELF/test |
| 29 | ../../../b2 toolset=gcc clean |
| 30 | rm -rf cov-int/ |
| 31 | cov-build --dir cov-int ../../../b2 toolset=gcc -q -j3 |
| 32 | tar cJf cov-int.tar.xz cov-int/ |
| 33 | curl --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" |