Skip to content

Commit

Permalink
Don't error out if we're not on the zeroth instance; use conditional …
Browse files Browse the repository at this point in the history
…instead.
  • Loading branch information
tadhg-ohiggins authored and mogul committed Aug 3, 2023
1 parent 8455755 commit f84d693
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions backend/.profile
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,20 @@ export NEW_RELIC_HOST="gov-collector.newrelic.com"
# We only want to run migrate and collecstatic for the first app instance, not
# for additional app instances, so we gate all of this behind CF_INSTANCE_INDEX
# being 0.
[ "$CF_INSTANCE_INDEX" = 0 ] &&
echo 'Starting API schema deprecation' &&
python manage.py drop_deprecated_api_schemas_and_views &&
echo 'Finished API schema deprecation' &&
echo 'Starting API schema creation' &&
python manage.py create_api_schemas &&
echo 'Finished API schema creation' &&
echo 'Starting migrate' &&
python manage.py migrate &&
echo 'Finished migrate' &&
echo 'Starting API view creation' &&
python manage.py create_api_views &&
echo 'Finished view creation' &&
echo 'Starting collectstatic' &&
python manage.py collectstatic --noinput &&
echo 'Finished collectstatic'
if [[ "$CF_INSTANCE_INDEX" == 0 ]]; then
echo 'Starting API schema deprecation' &&
python manage.py drop_deprecated_api_schemas_and_views &&
echo 'Finished API schema deprecation' &&
echo 'Starting API schema creation' &&
python manage.py create_api_schemas &&
echo 'Finished API schema creation' &&
echo 'Starting migrate' &&
python manage.py migrate &&
echo 'Finished migrate' &&
echo 'Starting API view creation' &&
python manage.py create_api_views &&
echo 'Finished view creation' &&
echo 'Starting collectstatic' &&
python manage.py collectstatic --noinput &&
echo 'Finished collectstatic'
fi

0 comments on commit f84d693

Please sign in to comment.