Use ENV variables in fr-dev

This allows folks to rename their database and still use the dev scripts
This commit is contained in:
Joel Bradshaw 2020-11-19 13:01:39 -08:00
parent dfc9262876
commit 3eb443c139
2 changed files with 8 additions and 5 deletions

View file

@ -1,5 +1,5 @@
# SECURITY WARNING: keep the secret key used in production secret! # SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY=7(2w1sedok=aznpq)ta1mc4i%4h=xx@hxwx*o57ctsuml0x%fr SECRET_KEY="7(2w1sedok=aznpq)ta1mc4i%4h=xx@hxwx*o57ctsuml0x%fr"
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG=true DEBUG=true
@ -25,7 +25,7 @@ POSTGRES_HOST=db
CELERY_BROKER=redis://redis:6379/0 CELERY_BROKER=redis://redis:6379/0
CELERY_RESULT_BACKEND=redis://redis:6379/0 CELERY_RESULT_BACKEND=redis://redis:6379/0
EMAIL_HOST='smtp.mailgun.org' EMAIL_HOST="smtp.mailgun.org"
EMAIL_PORT=587 EMAIL_PORT=587
EMAIL_HOST_USER=mail@your.domain.here EMAIL_HOST_USER=mail@your.domain.here
EMAIL_HOST_PASSWORD=emailpassword123 EMAIL_HOST_PASSWORD=emailpassword123

9
fr-dev
View file

@ -1,5 +1,8 @@
#!/bin/bash #!/bin/bash
# import our ENV variables
source .env
set -e set -e
set -x set -x
@ -39,8 +42,8 @@ case "$1" in
resetdb) resetdb)
clean clean
docker-compose up --build -d docker-compose up --build -d
execdb dropdb -U fedireads fedireads execdb dropdb -U ${POSTGRES_USER} ${POSTGRES_DB}
execdb createdb -U fedireads fedireads execdb createdb -U ${POSTGRES_USER} ${POSTGRES_DB}
initdb initdb
clean clean
;; ;;
@ -57,7 +60,7 @@ case "$1" in
execweb python manage.py shell execweb python manage.py shell
;; ;;
dbshell) dbshell)
execdb psql -U fedireads fedireads execdb psql -U ${POSTGRES_USER} ${POSTGRES_DB}
;; ;;
restart_celery) restart_celery)
docker-compose restart celery_worker docker-compose restart celery_worker