4 . .coverity.conf ||
exit 1
8 echo "Checking upload permissions..."
10 if ! up_perm
="$(wget https://scan.coverity.com/api/upload_permitted --post-data "token
=${COVTOKEN}&project
=${COVPROJECT}" -q -O -)"; then
11 echo "Coverity Scan API access denied: bad token?"
15 # Really up_perm is a JSON response with either
16 # {upload_permitted:true} or {next_upload_permitted_at:<date>}
17 # We do some hacky string parsing instead of properly parsing it.
19 *upload_permitted
*true
*)
20 echo "Coverity Scan: upload permitted"
22 *next_upload_permitted_at
*)
23 if [ -z "$COVERITY_DRYRUN" ]; then
24 echo "Coverity Scan: upload quota reached; stopping here"
25 # Exit success as this isn't a build error.
28 echo "Coverity Scan: upload quota reached, continuing dry run"
32 echo "Coverity Scan upload check: unexpected result $up_perm"
39 ## delete all previous tarballs
40 rm -f proxmark3.all.
*.tgz proxmark3.all.
*.log
42 TODAY
="$(date --date now +%Y%m%d.%H%M)"
44 DESCNAME
="manual_by_$NICKNAME.$TODAY.$(git describe --dirty --always)"
45 FILENAME
="proxmark3.all.$TODAY.tgz"
46 LOGFILENAME
="${FILENAME/.tgz/.log}"
49 tar cfz
"$FILENAME" "$COVDIR" ||
exit $?
50 echo "Coverity build file is ready"
52 ## upload tarball to Coverity.com
53 curl
--progress-bar --fail \
54 --form token
="$COVTOKEN" \
55 --form email
="$COVLOGIN" \
56 --form file="@$FILENAME" \
57 --form version
="$VERSION" \
58 --form description
="$DESCNAME" \
59 https
://scan.coverity.com
/builds?project
="${COVPROJECT}" | tee -a "${LOGFILENAME}" ; test "${PIPESTATUS[0]}" -eq 0 ||
exit $?
60 echo "tarball uploaded to Coverity for analyse"