Commit a852c09b authored by BAIRE Anthony's avatar BAIRE Anthony
Browse files

django container_init: initialise the db from scratch

This commit removes the calls to the '' script that
did a full a import of the rails db (rails apps will be imported

The django db is now initialised from scratch, using the db_seed command
parent 5f1166d6
......@@ -128,7 +128,7 @@ To set up the development environment, run:
**Note** by default `bootstrap` works on all containers. It is possible
to give an explicit list of containers instead. Example:
./bootstrap dev-mysql dev-rails
./bootstrap dev-mysql dev-django
4. for convenience, you may want to alias `docker-compose` as `fig` (because
......@@ -138,6 +138,11 @@ To set up the development environment, run:
alias fig=docker-compose
5. after bootstrap, in development the db is initialised with three users (all with the password `allgo`):
- `admin@localhost` which is superuser
- `devel@localhost` which is the owner of a webapp named `sleep`
- `guest@localhost`
### Common commands
......@@ -9,7 +9,22 @@ wait-mysql
mkdir -p /vol/cache/allgo
# import the rails database
/bin/bash /opt/allgo/tools/ -e allgo allgo "$ENV-mysql" allgo
/bin/bash /opt/allgo/tools/ -d allgo allgo "$ENV-mysql" allgo
/bin/bash /opt/allgo/tools/ -m allgo allgo "$ENV-mysql" allgo
mysql_cmd() {
mysql -uallgo -pallgo -h"$ENV-mysql"
# reset the database (if we are in development)
if [ "$ENV" = dev ] ; then
echo "DROP DATABASE IF EXISTS allgo;" | mysql_cmd
# create the database
echo "CREATE DATABASE allgo CHARACTER SET 'utf8';" | mysql_cmd
# create the tables (apply the migrations)
python3 migrate
# seed the db
python3 db_seed
-- NOTE: this script is no longer used at container init
-- (to be resurrected when we implement on-demand import of old allgo webapps)
-- Migrate user data
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment