Skip to content

Instantly share code, notes, and snippets.

@bkonkle
Created May 20, 2013 16:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bkonkle/5613414 to your computer and use it in GitHub Desktop.
Save bkonkle/5613414 to your computer and use it in GitHub Desktop.
The Jenkins build script we use on one of our projects.
#!/bin/bash
cd $WORKSPACE
#Get our virtual env setup
virtualenv -q ve
source ./ve/bin/activate
export DJANGO_SETTINGS_MODULE=myproject.conf.jenkins.settings
pip install -q --log=$WORKSPACE/pip.log --exists-action=w -r requirements.pip
pip install -q coverage pylint django_jenkins
#Put the app into sys.path
pip install -e .
mkdir -p $VIRTUAL_ENV/var/log
# Fake compass compile. Tests dependent on template rendering fail without this
touch myproject/static/css/screen.css
#Start-up solr
make solr-install
echo "SOLR_PATH=./ve/lib/solr" > .env
honcho start solr &
SOLR_PID=$!
trap "kill -SIGINT $SOLR_PID" EXIT
#Start-up Redis
export REDIS_PORT=6380
echo -e "port 6380\nloglevel warning" | redis-server - &
REDIS_PID=$!
trap "kill -SIGINT $REDIS_PID" EXIT
manage.py jenkins --pylint-rcfile=.pylintrc -v0
kill -SIGINT $SOLR_PID
kill -SIGINT $REDIS_PID
#Extract the Pylint score
PYLINT_SCORE=`grep "Your code has been rated" reports/pylint.report | cut -d" " -f7|cut -d"/" -f1`
echo "YVALUE=$PYLINT_SCORE" > pylint.properties
echo "COMPLETE: $PROJECT_NAME build"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment