Go back to exec for everything

This commit is contained in:
Jim Fingal 2020-11-08 17:30:47 -08:00
parent 21a0e4a8f2
commit 061193cdd5

38
fr-dev
View file

@ -8,18 +8,22 @@ function clean {
docker-compose rm -f docker-compose rm -f
} }
function rundb {
docker-compose exec db $@
}
function runweb { function runweb {
docker-compose run --rm web "$@" docker-compose run --rm web "$@"
clean clean
} }
function execdb {
docker-compose exec db $@
}
function execweb {
docker-compose exec web "$@"
}
function initdb { function initdb {
runweb python manage.py migrate execweb python manage.py migrate
runweb python manage.py initdb execweb python manage.py initdb
} }
case "$1" in case "$1" in
@ -35,42 +39,42 @@ case "$1" in
resetdb) resetdb)
clean clean
docker-compose up --build -d docker-compose up --build -d
rundb dropdb -U fedireads fedireads execdb dropdb -U fedireads fedireads
rundb createdb -U fedireads fedireads execdb createdb -U fedireads fedireads
initdb initdb
clean clean
;; ;;
makemigrations) makemigrations)
runweb python manage.py makemigrations execweb python manage.py makemigrations
;; ;;
migrate) migrate)
runweb python manage.py migrate execweb python manage.py migrate
;; ;;
bash) bash)
runweb bash execweb bash
;; ;;
shell) shell)
runweb python manage.py shell execweb python manage.py shell
;; ;;
dbshell) dbshell)
rundb psql -U fedireads fedireads execdb psql -U fedireads fedireads
;; ;;
restart_celery) restart_celery)
docker-compose restart celery_worker docker-compose restart celery_worker
;; ;;
test) test)
shift 1 shift 1
runweb coverage run --source='.' --omit="*/test*,celerywyrm*,bookwyrm/migrations/*" manage.py test "$@" execweb coverage run --source='.' --omit="*/test*,celerywyrm*,bookwyrm/migrations/*" manage.py test "$@"
;; ;;
pytest) pytest)
shift 1 shift 1
runweb pytest "$@" execweb pytest "$@"
;; ;;
test_report) test_report)
runweb coverage report execweb coverage report
;; ;;
collectstatic) collectstatic)
runweb python manage.py collectstatic --no-input execweb python manage.py collectstatic --no-input
;; ;;
build) build)
docker-compose build docker-compose build