Commit e6f46cf3 authored by Lasse Karstensen's avatar Lasse Karstensen Committed by Pål Hermunn Johansen

Add script to run Coverity.

This will allow anyone with the Coverity scanner installed and our
authtoken to upload their own feature branch if they want to.

Main point is to get this out of the Jenkins job definition and into
something that is more developer accessible.

Doing my best to keep it /bin/sh compatible.
parent 5d0103ab
......@@ -109,3 +109,7 @@ cscope.*out
/bin/varnishtest/tests/*.log
/bin/varnishtest/tests/*.log-t
/bin/varnishtest/test-suite.log
#
# Coverity output
/cov-int
/myproject.tgz
#!/bin/sh
#
# Build Varnish under Coverity, and upload the output to Coverity Scan.
#
# Requires the Coverity scanner in $PATH and the upload token set in $COVTOKEN.
#
# See https://github.com/varnishcache/varnish-cache/wiki/Coverity-scans for overview.
#
if [ -z "$COVTOKEN" ]; then
echo "ERROR: No COVTOKEN in environment"
exit 1
fi
if [ -z "`which cov-build`" ]; then
echo "ERROR: No Coverity (cov-build) in \$PATH. Download: https://scan.coverity.com/download?tab=cxx"
exit 1
fi
if [ -z "$EMAIL" ]; then
EMAIL="varnish-dev@varnish-cache.org"
fi
GITREF=`git rev-parse --short HEAD`
GITBRANCH=`git rev-parse --abbrev-ref HEAD`
# Do a dirty check.
DIRT=`git status --porcelain 2>/dev/null | egrep '^(\ M|M)' | grep -v coverity-run`
if [ -n "$DIRT" ]; then
printf "ERROR: Refusing to analyse a dirty tree.\n$DIRT\n"
exit 2
fi
test "`basename $PWD`" = "devscripts" && cd ..
make distclean || true
test -f configure || ./autogen.sh
./configure
cov-build --dir cov-int make
# the web ui seems to require the file to be called myproject.tgz. Very cute.
tar cvfz myproject.tgz cov-int
curl --form token=$COVTOKEN \
--form "email=$EMAIL" \
--form "file=@myproject.tgz" \
--form version="$GITREF" \
--form description="description=${GITBRANCH}_branch" \
'https://scan.coverity.com/builds?project=varnish'
rm myproject.tgz
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment