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