Skip to content

Instantly share code, notes, and snippets.

@devinshields
Created January 18, 2016 20:13
Show Gist options
  • Save devinshields/ba913df8ccda143c933c to your computer and use it in GitHub Desktop.
Save devinshields/ba913df8ccda143c933c to your computer and use it in GitHub Desktop.
jenkins_nosetests_build_script.sh
#
# source: http://www.alexconrad.org/2011/10/jenkins-and-python.html?m=1
#
PYENV_HOME=$WORKSPACE/.pyenv/
# Delete previously built virtualenv
if [ -d $PYENV_HOME ]; then
rm -rf $PYENV_HOME
fi
# Create virtualenv and install necessary packages
virtualenv --no-site-packages $PYENV_HOME
. $PYENV_HOME/bin/activate
pip install --quiet nosexcover
pip install --quiet pylint
pip install --quiet $WORKSPACE/ # where your setup.py lives
nosetests --with-xcoverage --with-xunit --cover-package=myapp --cover-erase
pylint -f parseable myapp/ | tee pylint.out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment