diff options
author | Francois-Xavier Le Bail <fx.lebail@yahoo.com> | 2014-04-15 16:14:01 +0200 |
---|---|---|
committer | Francois-Xavier Le Bail <fx.lebail@yahoo.com> | 2014-04-15 16:14:01 +0200 |
commit | 287d5f64f0dd33b5867035d123d39aeed04bf506 (patch) | |
tree | c3d23eae0574765a6705c296814b4f6c49de7db7 /.travis-coverity-scan-build.sh | |
parent | 110c0968605557b84f1197e0d7379282e7ed81f7 (diff) | |
download | tcpdump-287d5f64f0dd33b5867035d123d39aeed04bf506.tar.gz |
Coverity: customize the build script
- add a 'Verify Coverity Scan run condition' step to avoid multiple runs with
Travis matrix.
- add a 'Verify Coverity Scan script test mode' step. if true no uploading, to
avoid reaching the quota. usual processing: false.
- send 'description' as VERSION#SHA (e.g.: 4.6.0-PRE-GIT#c661f8b)
Diffstat (limited to '.travis-coverity-scan-build.sh')
-rw-r--r-- | .travis-coverity-scan-build.sh | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/.travis-coverity-scan-build.sh b/.travis-coverity-scan-build.sh index 9ea7baf5..92e3f653 100644 --- a/.travis-coverity-scan-build.sh +++ b/.travis-coverity-scan-build.sh @@ -17,6 +17,16 @@ TOOL_BASE=/tmp/coverity-scan-analysis UPLOAD_URL="http://scan5.coverity.com/cgi-bin/travis_upload.py" SCAN_URL="https://scan.coverity.com" +# Verify Coverity Scan run condition +COVERITY_SCAN_RUN_CONDITION=${coverity_scan_run_condition:-true} +echo -ne "\033[33;1mTesting '${COVERITY_SCAN_RUN_CONDITION}' condition... " +if eval [ $COVERITY_SCAN_RUN_CONDITION ]; then + echo -e "True.\033[0m" +else + echo -e "False. Exit.\033[0m" + exit 1 +fi + # Do not run on pull requests if [ "${TRAVIS_PULL_REQUEST}" = "true" ]; then echo -e "\033[33;1mINFO: Skipping Coverity Analysis: branch is a pull request.\033[0m" @@ -79,6 +89,13 @@ echo -e "\033[33;1mTarring Coverity Scan Analysis results...\033[0m" RESULTS_ARCHIVE=analysis-results.tgz tar czf $RESULTS_ARCHIVE $RESULTS_DIR SHA=`git rev-parse --short HEAD` +VERSION_SHA=$(cat VERSION)#$SHA + +# Verify Coverity Scan script test mode +if [ "$coverity_scan_script_test_mode" = true ]; then + echo -e "\033[33;1mCoverity Scan configured in script test mode. Exit.\033[0m" + exit 1 +fi echo -e "\033[33;1mUploading Coverity Scan Analysis results...\033[0m" curl \ @@ -88,5 +105,5 @@ curl \ --form email=$COVERITY_SCAN_NOTIFICATION_EMAIL \ --form file=@$RESULTS_ARCHIVE \ --form version=$SHA \ - --form description="Travis CI build" \ + --form description="$VERSION_SHA" \ $UPLOAD_URL |