Skip to content

Commit

Permalink
Initial work toward hudson build script
Browse files Browse the repository at this point in the history
  • Loading branch information
lmorchard committed Aug 11, 2010
1 parent 718bc02 commit 9afb1ce
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Original file line Diff line number Diff line change
@@ -1,8 +1,14 @@
env/
venv/
tmp/ tmp/
src/ src/
site_media/ site_media/
pip-log.txt pip-log.txt
local_settings.py local_settings.py
settings_local.py
nosetests.xml
.coverage
coverage.xml
*.pyc *.pyc
*.swp *.swp
*.db *.db
37 changes: 37 additions & 0 deletions scripts/build.sh
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
# This script should run from inside Hudson

cd $WORKSPACE
VENV=$WORKSPACE/venv

echo "Starting build..."

# Clean up after last time.
find . -name '*.pyc' | xargs rm

if [ ! -d "$VENV/bin" ]; then
echo "No virtualenv found; making one..."
virtualenv --no-site-packages $VENV
fi

source $VENV/bin/activate

pip install -qr requirements/dev.txt

cat > settings_local.py <<SETTINGS
import logging
from settings import *
LOG_LEVEL = logging.ERROR
INSTALLED_APPS += [ "django_nose", ]
SOUTH_TESTS_MIGRATE = False
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
CACHE_BACKEND = 'locmem://'
MAILER_EMAIL_BACKEND = 'django.core.mail.backends.locmem.EmailBackend'
SETTINGS

echo "Starting tests..."
export FORCE_DB=1
coverage run manage.py test apps/badges --noinput --with-freshen --with-xunit --tags=~@TODO -a\!TODO
coverage xml $(find apps libs -name '*.py')

echo 'Mushroom mushroom!'
4 changes: 2 additions & 2 deletions settings.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -289,9 +289,9 @@ def write(*args, **kwargs):
"INTERCEPT_REDIRECTS": False, "INTERCEPT_REDIRECTS": False,
} }


# local_settings.py can be used to override environment-specific settings # settings_local.py can be used to override environment-specific settings
# like database and email that differ between development and production. # like database and email that differ between development and production.
try: try:
from local_settings import * from settings_local import *
except ImportError: except ImportError:
pass pass
File renamed without changes.

0 comments on commit 9afb1ce

Please sign in to comment.