Merge pull request #1211 from cincodenada/fix-resetdb

Fix bw-dev resetdb, some tweaks to bw-dev
This commit is contained in:
Mouse Reeve 2021-07-06 16:02:46 -06:00 committed by GitHub
commit 52713ec8d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 2 deletions

16
bw-dev
View File

@ -39,7 +39,9 @@ function makeitblack {
} }
CMD=$1 CMD=$1
shift if [ -n "$CMD" ]; then
shift
fi
# show commands as they're executed # show commands as they're executed
set -x set -x
@ -56,9 +58,12 @@ case "$CMD" in
;; ;;
resetdb) resetdb)
clean clean
docker-compose up --build -d # Start just the DB so no one else is using it
docker-compose up --build -d db
execdb dropdb -U ${POSTGRES_USER} ${POSTGRES_DB} execdb dropdb -U ${POSTGRES_USER} ${POSTGRES_DB}
execdb createdb -U ${POSTGRES_USER} ${POSTGRES_DB} execdb createdb -U ${POSTGRES_USER} ${POSTGRES_DB}
# Now start up web so we can run the migrations
docker-compose up --build -d web
initdb initdb
clean clean
;; ;;
@ -110,7 +115,14 @@ case "$CMD" in
generate_preview_images) generate_preview_images)
runweb python manage.py generate_preview_images $@ runweb python manage.py generate_preview_images $@
;; ;;
runweb)
runweb "$@"
;;
rundb)
rundb "$@"
;;
*) *)
set +x # No need to echo echo
echo "Unrecognised command. Try: build, clean, up, initdb, resetdb, makemigrations, migrate, bash, shell, dbshell, restart_celery, test, pytest, test_report, black, populate_streams, generate_preview_images" echo "Unrecognised command. Try: build, clean, up, initdb, resetdb, makemigrations, migrate, bash, shell, dbshell, restart_celery, test, pytest, test_report, black, populate_streams, generate_preview_images"
;; ;;
esac esac