From d59c331c48e4b6f7870b91c71d7bd76656acd3aa Mon Sep 17 00:00:00 2001 From: Adam Kelly Date: Mon, 30 Mar 2020 19:15:36 +0100 Subject: [PATCH] fr-dev - script for common development tasks. --- fr-dev | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 fr-dev diff --git a/fr-dev b/fr-dev new file mode 100755 index 00000000..d4810b6d --- /dev/null +++ b/fr-dev @@ -0,0 +1,38 @@ +#!/bin/bash + +set -e +set -x + +case "$1" in + up) + docker-compose build + docker-compose up + ;; + initdb) + docker-compose exec web python manage.py migrate + docker-compose exec web python manage.py shell -c 'import init_db' + ;; + resetdb) + docker-compose stop web + docker-compose exec db dropdb -U fedireads fedireads + docker-compose exec db createdb -U fedireads fedireads + docker-compose start web + docker-compose exec web python manage.py migrate + docker-compose exec web python manage.py shell -c 'import init_db' + ;; + makemigrations) + docker-compose exec web python manage.py makemigrations + ;; + migrate) + docker-compose exec web python manage.py migrate + ;; + shell) + docker-compose exec web python manage.py shell + ;; + dbshell) + docker-compose exec db psql -U fedireads fedireads + ;; + *) + echo "Unrecognised command." + ;; +esac