-
Notifications
You must be signed in to change notification settings - Fork 295
/
Copy pathjenkins-build.sh
executable file
·86 lines (69 loc) · 2.05 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
83
84
85
86
#!/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 nose coverage
./setup.py develop
make coverage
# we need to get coverage to look at our scripts. Since they aren't in a
# python module we can't tell nosetests to look for them (via an import
# statement). So we run nose inside of coverage.
make doc
pip install --quiet pylint
make pylint
if [[ -n "${coverage_post}" ]]
# was -v coverage_post but OS X bash not new enough
then
pip install -U gcovr
# work around a bug in 3.1 ?
# pip install -e git+git@github.com:nschum/gcovr.git@fix-argument-type#egg=gcovr
# gcovr -r $PWD --xml > coverage-gcovr.xml
gcovr --xml > coverage-gcovr.xml
make cppcheck
make doxygen
fi