pong
[auf_skeleton_django.git] / bin / deploy
CommitLineData
73d714db
OL
1#! /bin/bash
2
7adc7f71 3PYTHON="python2.6"
73d714db 4ROOT_PATH=.
7adc7f71
OL
5PROJECT_NAME="{{ project_name }}"
6
73d714db 7if [ ! -e "$ROOT_PATH/README.rst" ]; then
7adc7f71 8 echo "Placez vous a la racine du projet."
73d714db
OL
9 exit -1
10fi
11
12
13BUILD=$1
14if [ "$BUILD" = "" ]; then
15 BUILD='production'
16fi
17REQUIREMENTS=$ROOT_PATH/requirements/$BUILD.txt
7adc7f71 18SETTINGS=$PROJECT_NAME.settings.$BUILD
73d714db
OL
19
20
21VENV_PATH=$ROOT_PATH/.virtualenv
22if [ -e "$VENV_PATH" ]; then
7adc7f71 23 echo "l'environnement virtuel existe deja."
73d714db 24else
7adc7f71 25 echo "Creation de l'environnement virtuel."
73d714db
OL
26 virtualenv --python=$PYTHON $VENV_PATH
27 rm -f distribute*.tar.gz
28fi
29
30echo "Activation de l'environnement virtuel."
31source $VENV_PATH/bin/activate
32which python
33
34
7adc7f71 35echo "Installation des dependances."
73d714db
OL
36pip install -r $REQUIREMENTS
37
38echo "Commandes Django"
39$ROOT_PATH/bin/django syncdb --settings=$SETTINGS --noinput
40$ROOT_PATH/bin/django migrate --settings=$SETTINGS --noinput
41$ROOT_PATH/bin/django collectstatic --settings=$SETTINGS --noinput