From f84d693e0e81e2b35307ba20afb2eb005e0c7ba0 Mon Sep 17 00:00:00 2001 From: Tadhg O'Higgins <2626258+tadhg-ohiggins@users.noreply.github.com> Date: Wed, 2 Aug 2023 15:36:49 -0700 Subject: [PATCH] Don't error out if we're not on the zeroth instance; use conditional instead. --- backend/.profile | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/backend/.profile b/backend/.profile index ab4bf1635a..32a078db7f 100644 --- a/backend/.profile +++ b/backend/.profile @@ -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