5 token=${COVERITY_TOKEN}
6 email=dbarach@cisco.com
8 project_encoded="fd.io+VPP"
9 url=https://scan.coverity.com
11 export COV_HOST=$(hostname -f)
14 # Location of various directories
16 # run script from .../build-root
19 covdir="${build_dir}/cov-int"
20 COVTOOLS="${COVTOOLS-/scratch/cov-analysis-latest}"
22 # Before we run the build, check that we can submit one
23 check=$(curl -s --form project="${project}" \
24 --form token="${token}" "${url}/api/upload_permitted")
25 if [ "${check}" = "Access denied" ]; then
26 echo "Bad token or project name."
29 if [ "${check}" != '{"upload_permitted":true}' ]; then
30 echo "Upload not permitted; stop now..."
34 version=$(git describe)
38 "${COVTOOLS}/bin/cov-build" --dir "${covdir}" make bootstrap build-coverity
41 # Tar the build artifacts that scan wants
42 tar -czf fd.io-vpp.tgz "$(basename ${covdir})"
46 echo curl --form token="${token}" \
47 --form email="${email}" \
48 --form file=@fd.io-vpp.tgz \
49 --form version="${version}" \
50 --form description="master:${version}" \
51 "${url}/builds?project=${project_encoded}"