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