Skip to content

Instantly share code, notes, and snippets.

@mosdevly
Forked from dexterous/jenkins.sh
Last active August 29, 2015 14:27
Show Gist options
  • Save mosdevly/74284125d7eb358ec878 to your computer and use it in GitHub Desktop.
Save mosdevly/74284125d7eb358ec878 to your computer and use it in GitHub Desktop.
template jenkins/hudson build script for python with virtualenv
# WORKSPACE set to job workspace by jenkins/hudson
VENV="$WORKSPACE/.env"
if [ ! -e "$VENV" ]; then
virtualenv --python python2.6 --no-site-packages $VENV
elif [ ! -d "$VENV" ]; then
echo '$VENV exists but is not a directory'
exit 1
fi
. .env/bin/activate
python setup.py develop
nosetests --with-xunit test/
deactivate
# follow this up by publishing nostests.xml as JUnit test result report
# you could also have the xunit report generated at an alternate location/name using --xunit-file argument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment