Skip to content

Commit

Permalink
Fix: sample env and reset_db helper (#1914)
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman committed Feb 29, 2024
2 parents 1cb08ff + 67bc3f4 commit 4a266d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
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

0 comments on commit 4a266d6

Please sign in to comment.