commentaire
[auf_skeleton_django.git] / bin / deploy
... / ...
CommitLineData
1#! /bin/bash
2
3ROOT_PATH=.
4PROJECT_NAME="{{ project_name }}"
5
6if [ ! -e "$ROOT_PATH/README.rst" ]; then
7 echo "Placez vous a la racine du projet."
8 exit -1
9fi
10
11
12BUILD=$1
13if [ "$BUILD" = "" ]; then
14 BUILD='production'
15fi
16REQUIREMENTS=$ROOT_PATH/requirements/$BUILD.txt
17SETTINGS=$PROJECT_NAME.settings.$BUILD
18
19
20VENV_PATH=$ROOT_PATH/.virtualenv
21if [ -e "$VENV_PATH" ]; then
22 echo "l'environnement virtuel existe deja."
23else
24 echo "Creation de l'environnement virtuel."
25 virtualenv $VENV_PATH
26 rm -f distribute*.tar.gz
27fi
28
29echo "Activation de l'environnement virtuel."
30source $VENV_PATH/bin/activate
31which python
32
33
34echo "Installation des dependances."
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