From 84ab9fcc824ad456c2afbbdc095fe9c257c23f87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Thu, 16 Jun 2016 00:25:59 +0200 Subject: [PATCH] Ajoute la base de test dans la config vagrant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Au setup d'une nouvelle VM de test, la base de donnée dans `test_db/` est chargée par django. On commence avec une BDD non vide. --- provisioning/bootstrap.sh | 2 +- provisioning/prepare_django.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 provisioning/prepare_django.sh diff --git a/provisioning/bootstrap.sh b/provisioning/bootstrap.sh index dde6e24a..64d74e87 100644 --- a/provisioning/bootstrap.sh +++ b/provisioning/bootstrap.sh @@ -45,4 +45,4 @@ cd /vagrant sudo -H -u vagrant pip install --user -r requirements.txt -r requirements-devel.txt # Préparation de Django -sudo -H -u vagrant DJANGO_SETTINGS_MODULE='cof.settings_dev' DBUSER=$DBUSER DBNAME=$DBNAME DBPASSWD=$DBPASSWD python manage.py migrate +sudo -H -u vagrant DJANGO_SETTINGS_MODULE='cof.settings_dev' DBUSER=$DBUSER DBNAME=$DBNAME DBPASSWD=$DBPASSWD sh provisioning/prepare_django.sh diff --git a/provisioning/prepare_django.sh b/provisioning/prepare_django.sh new file mode 100644 index 00000000..68b7da6c --- /dev/null +++ b/provisioning/prepare_django.sh @@ -0,0 +1,4 @@ +# Doit être lancé par bootstrap.sh + +python manage.py migrate +python manage.py loaddata test_db/users.json test_db/bda.json test_db/gestion.json