coverity.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. # To skip the coverity integration download (which is huge) if
  10. # you already have it from a previous run, add --skipdownload
  11. #
  12. #
  13. # Environment Variables
  14. #
  15. # COVERITY_SCAN_NOTIFICATION_EMAIL - email address to notify
  16. # COVERITY_SCAN_TOKEN - the Coverity Scan token (should be secure)
  17. # SELF - the boost libs directory name
  18. set -ex
  19. pushd /tmp
  20. if [[ "$1" != "--skipdownload" ]]; then
  21. rm -rf coverity_tool.tgz cov-analysis*
  22. wget 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. fi
  25. COVBIN=$(echo $(pwd)/cov-analysis*/bin)
  26. export PATH=$COVBIN:$PATH
  27. popd
  28. ci/build.sh clean
  29. rm -rf cov-int/
  30. cov-build --dir cov-int ci/build.sh
  31. tar cJf cov-int.tar.xz cov-int/
  32. curl --form token="$COVERITY_SCAN_TOKEN" \
  33. --form email="$COVERITY_SCAN_NOTIFICATION_EMAIL" \
  34. --form file=@cov-int.tar.xz \
  35. --form version="$(git describe --tags)" \
  36. --form description="boostorg/$SELF" \
  37. https://scan.coverity.com/builds?project="boostorg/$SELF"