Skip to content

Instantly share code, notes, and snippets.

@dexterous
Created September 13, 2011 09:20
Show Gist options
  • Save dexterous/1213471 to your computer and use it in GitHub Desktop.
Save dexterous/1213471 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