aboutsummaryrefslogtreecommitdiff
path: root/unit-test.sh
blob: da7073e12a55480eff714bf5db910f20b194b8e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh -e

HERE=$(dirname $(readlink -f $0))
cd $HERE

SKIP_LINT="${SKIP_LINT-1}"
VENV_DIR="${VENV_DIR-$HERE/.venv}"

if [ ! -f /usr/bin/virtualenv ] ; then
	echo "installing python-virutalenv"
	sudo apt-get install -f python-virtualenv
fi

if [ -z $VIRTUAL_ENV ] ; then
	echo "creating venv: $VENV_DIR ..."
	virtualenv --python=`which python2` $VENV_DIR
	. $VENV_DIR/bin/activate
	pip install -r requirements.txt
fi

rm -rf static/*

DJANGO_SETTINGS_MODULE=settings SKIP_LINT=$SKIP_LINT ./manage.py collectstatic --no-input
DJANGO_SETTINGS_MODULE=settings SKIP_LINT=$SKIP_LINT ./manage.py test license_protected_downloads