-
Notifications
You must be signed in to change notification settings - Fork 10
/
jenkins.sh
executable file
·32 lines (30 loc) · 1.11 KB
/
jenkins.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
#!/bin/bash
# Jenkins script to run tests under CI
#
# Tim Sutton, November 2013
export USER_MAP_LOGFILE='/tmp/user_map-jenkins.log'
cp users/config.py.test users/config.py
rm -rf venv
virtualenv venv
source venv/bin/activate
venv/bin/pip install -r requirements.txt
venv/bin/pip install pep8 pylint nose nosexcover
if [ -f users.db ];
then
rm users.db
fi
if [ -f test_users.db ];
then
rm test_users.db
fi
export PYTHONPATH=`pwd`/users:`pwd`:`pwd`/venv/lib/python2.7/site-packages/
nosetests -v --with-id --with-xcoverage --with-xunit --verbose --cover-package=users users
#rm -f pylint.log
# We do || exit 0 to prevent the build failing even for small jenkins warnings
# see http://stackoverflow.com/questions/7347233/jenkins-with-pylint-gives-build-failure
# pylint --output-format=parseable --reports=y --rcfile=pylintrc users > pylint.log || exit 0
pylint --output-format=parseable --reports=y --rcfile=pylintrc users > pylint.log
# || exit 0 is only needed when jenkins calls pylint directly, not
# when it is pylint is run from in a shell script.
pep8 --repeat --ignore W391 --exclude venv,none.py users > pep8.log
deactivate