Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: sample env and reset_db helper #1914

Merged
merged 2 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ DJANGO_DB_DIR=.
DJANGO_DB_FILE=django.db
DJANGO_DB_FIXTURES="benefits/core/migrations/local_fixtures.json"

testsecret=Hello from the local environment!
auth_provider_client_id=benefits-oauth-client-id
courtesy_card_verifier_api_auth_key=server-auth-token
mobility_pass_verifier_api_auth_key=server-auth-token
Expand All @@ -22,3 +21,5 @@ sacrt_payment_processor_client_cert_root_ca='-----BEGIN CERTIFICATE-----\nPEM DA
sbmtd_payment_processor_client_cert='-----BEGIN CERTIFICATE-----\nPEM DATA\n-----END CERTIFICATE-----'
sbmtd_payment_processor_client_cert_private_key='-----BEGIN RSA PRIVATE KEY-----\nPEM DATA\n-----END RSA PRIVATE KEY-----'
sbmtd_payment_processor_client_cert_root_ca='-----BEGIN CERTIFICATE-----\nPEM DATA\n-----END CERTIFICATE-----'

testsecret="Hello from the local environment!"
6 changes: 2 additions & 4 deletions bin/reset_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ set -ex

# whether to reset database file, defaults to true
DB_RESET="${DJANGO_DB_RESET:-true}"
# optional fixtures to import
FIXTURES="${DJANGO_DB_FIXTURES}"

if [[ $DB_RESET = true ]]; then
# construct the path to the database file from environment or default
Expand All @@ -25,11 +23,11 @@ else
echo "DB_RESET is false, skipping"
fi

valid_fixtures=$( echo $FIXTURES | grep -e fixtures\.json$ )
valid_fixtures=$(echo "$DJANGO_DB_FIXTURES" | grep -e fixtures\.json$)

if [[ -n "$valid_fixtures" ]]; then
# load data fixtures
python manage.py loaddata "$FIXTURES"
python manage.py loaddata "$DJANGO_DB_FIXTURES"
else
echo "No JSON fixtures to load"
fi
Loading