codeship

Update:

Askbot just upgraded their Django-avatar version so we don’t have to compile PIL anymore.

Codeship is a great tool for private continuous integration system. But setting up a project that uses Askbot can be a bit troublesome, since we have to compile PIL to support avatar module in offerQA. Mainly because it is not possible to symblink /usr/include/freetype2 to /usr/include/freetype. But later I realized that pip also searches in ~/.virtualenv/include folder so things became much easier. A local_setting file is also created specifically for Codeship database and Redis. Here is my setup commands:

pip install -r requirements-dev.txt
pip install redis
# Use settings for CI
ln -s local_settings.ci local_settings.py
# Sync your DB for django projects
python manage.py syncdb --noinput
# Run migrations for your django project
python manage.py migrate --noinput

And here is my test commands:

# Running your Django tests
python manage.py test

The local_settings.ci file:

# -*- coding: utf-8 -*-
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': 'default.db',
        'USER': '',
        'PASSWORD': '',
        'HOST': '',
        'PORT': ''
    }
}
CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
        'LOCATION': 'offerqa',
        'CACHE_TIMEOUT' : 60,
        'KEY_PREFIX': 'askbot',
    }
}