coverity-scan.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #/bin/bash
  2. token=
  3. [ -f .coverity-token ] && token="$(<.coverity-token)"
  4. [ -z "${token}" ] && \
  5. echo >&2 "Save the coverity token to .coverity-token" && \
  6. exit 1
  7. echo >&2 "Coverity token: ${token}"
  8. covbuild="$(which cov-build 2>/dev/null || command -v cov-build 2>/dev/null)"
  9. [ -z "${covbuild}" -a -f .coverity-build ] && covbuild="$(<.coverity-build)"
  10. [ -z "${covbuild}" ] && \
  11. echo "Save command the full filename of cov-build in .coverity-build" && \
  12. exit 1
  13. [ ! -x "${covbuild}" ] && \
  14. echo "The command ${covbuild} is not executable. Save command the full filename of cov-build in .coverity-build" && \
  15. exit 1
  16. version="$(cat config.h | grep "^#define PACKAGE_VERSION" | cut -d '"' -f 2)"
  17. echo >&2 "Working on netdata version: ${version}"
  18. echo >&2 "Cleaning up old builds..."
  19. make clean || exit 1
  20. [ -d "cov-int" ] && \
  21. rm -rf "cov-int"
  22. [ -f netdata-coverity-analysis.tgz ] && \
  23. rm netdata-coverity-analysis.tgz
  24. "${covbuild}" --dir cov-int make -j4 || exit 1
  25. tar czvf netdata-coverity-analysis.tgz cov-int || exit 1
  26. curl --form token="${token}" \
  27. --form email=costa@tsaousis.gr \
  28. --form file=@netdata-coverity-analysis.tgz \
  29. --form version="${version}" \
  30. --form description="netdata, real-time performance monitoring, done right." \
  31. https://scan.coverity.com/builds?project=firehol%2Fnetdata