/
jenkins-build.sh
executable file
·82 lines (64 loc) · 1.88 KB
/
jenkins-build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
cov_analysis_dir=/usr/local/cov-analysis-linux64-6.6.1/bin
cov_analysis_bin=cov-build
rm -Rf .env build dist khmer/_khmermodule.so cov-int
virtualenv .env
. .env/bin/activate
make clean
unset coverage_pre coverage_post coverity
if [[ "${NODE_LABELS}" == *linux* ]]
then
if type gcov >/dev/null 2>&1
then
export CFLAGS="-pg -fprofile-arcs -ftest-coverage"
coverage_post='--debug --inplace --libraries gcov'
else
echo "gcov was not found, skipping coverage check"
fi
else
echo "Not on a Linux node, skipping coverage check"
fi
if [[ "${JOB_NAME}" == khmer-multi/* ]]
then
if [[ -x ${cov_analysis_dir}/${cov_analysis_bin} ]]
then
if [[ -n "${COVERITY_TOKEN}" ]]
#was -v COVERITY_TOKEN, but OS X bash not new enough
then
PATH=${PATH}:${cov_analysis_dir}
coverity="${cov_analysis_bin} --dir cov-int"
else
echo "Missing coverity credentials, skipping scan"
fi
else
echo "${cov_analysis_bin} does not exist in \
${cov_analysis_dir}. Skipping coverity scan."
fi
else
echo "Not the main build so skipping the coverity scan"
fi
${coverity} python setup.py build_ext ${coverage_post}
if [[ -n "$coverity" ]]
# was -v coverity but OS X bash not new enough
then
tar czf khmer-cov.tgz cov-int
curl --form project=Khmer --form token=${COVERITY_TOKEN} --form \
email=mcrusoe@msu.edu --form file=@khmer-cov.tgz --form \
version=0.0.0.${BUILD_TAG} \
http://scan5.coverity.com/cgi-bin/upload.py
fi
pip install --quiet nosexcover
python setup.py nosetests --with-xcoverage --with-xunit --cover-package=khmer \
--cover-erase --attr=\!known_failing
make doc
pip install --quiet pylint
pylint -f parseable khmer/*.py scripts/*.py tests khmer | tee ../pylint.out
if [[ -n "${coverage_post}" ]]
# was -v coverage_post but OS X bash not new enough
then
pip install -U gcovr
gcovr -r $PWD --xml > coverage-gcovr.xml
make cppcheck
mkdir -p doc/doxygen
doxygen
fi