Permalink
Browse files

Initial work toward hudson build script

  • Loading branch information...
1 parent 718bc02 commit 9afb1ce22cb7afaea0cfd27198ebe1b29481ca1d @lmorchard committed Aug 11, 2010
Showing with 45 additions and 2 deletions.
  1. +6 −0 .gitignore
  2. +37 −0 scripts/build.sh
  3. +2 −2 settings.py
  4. 0 local_settings.py-dist → settings_local.py-dist
View
6 .gitignore
@@ -1,8 +1,14 @@
+env/
+venv/
tmp/
src/
site_media/
pip-log.txt
local_settings.py
+settings_local.py
+nosetests.xml
+.coverage
+coverage.xml
*.pyc
*.swp
*.db
View
37 scripts/build.sh
@@ -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!'
View
4 settings.py
@@ -289,9 +289,9 @@ def write(*args, **kwargs):
"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.
try:
- from local_settings import *
+ from settings_local import *
except ImportError:
pass
View
0 local_settings.py-dist → settings_local.py-dist
File renamed without changes.

0 comments on commit 9afb1ce

Please sign in to comment.