From c89200a8332442817ecae8800c8a8dc95eab53a1 Mon Sep 17 00:00:00 2001 From: Ben Thorner Date: Thu, 27 May 2021 10:03:08 +0100 Subject: [PATCH] Fix 'flask db upgrade' not working on CI Related to: https://github.com/alphagov/notifications-aws/pull/905 Previously this would fail because the Docker image we use for CI builds doesn't have an 'environment.sh' file; it uses preset env vars instead. This makes the command to upgrade the DB optional - if the env file is missing, the error should be self evident. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 81e8a4da6..720b52159 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ NOTIFY_CREDENTIALS ?= ~/.notify-credentials bootstrap: generate-version-file ## Set up everything to run the app pip3 install -r requirements_for_test.txt createdb notification_api || true - . environment.sh && flask db upgrade + (. environment.sh && flask db upgrade) || flask db upgrade .PHONY: run-flask run-flask: ## Run flask