From 5a3110c5ee49e5ce1518a5fa24768d48dbd6feea Mon Sep 17 00:00:00 2001 From: David McDonald Date: Tue, 3 Mar 2020 11:51:50 +0000 Subject: [PATCH] Reorganise makefile Also remove `check-env-vars` which is not being used anywhere --- Makefile | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 4d3b094bf..69d86e52e 100644 --- a/Makefile +++ b/Makefile @@ -26,29 +26,13 @@ CF_MANIFEST_FILE = manifest-$(firstword $(subst -, ,$(subst notify-,,${CF_APP})) NOTIFY_CREDENTIALS ?= ~/.notify-credentials + +## DEVELOPMENT + .PHONY: help help: @cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' -.PHONY: check-env-vars -check-env-vars: ## Check mandatory environment variables - $(if ${DEPLOY_ENV},,$(error Must specify DEPLOY_ENV)) - -.PHONY: preview -preview: ## Set environment to preview - $(eval export DEPLOY_ENV=preview) - @true - -.PHONY: staging -staging: ## Set environment to staging - $(eval export DEPLOY_ENV=staging) - @true - -.PHONY: production -production: ## Set environment to production - $(eval export DEPLOY_ENV=production) - @true - .PHONY: generate-version-file generate-version-file: ## Generates the app version file @echo -e "__travis_commit__ = \"${GIT_COMMIT}\"\n__time__ = \"${DATE}\"\n__travis_job_number__ = \"${BUILD_NUMBER}\"\n__travis_job_url__ = \"${BUILD_URL}\"" > ${APP_VERSION_FILE} @@ -120,6 +104,24 @@ clean-docker-containers: ## Clean up any remaining docker containers clean: rm -rf node_modules cache target venv .coverage build tests/.cache + +## DEPLOYMENT + +.PHONY: preview +preview: ## Set environment to preview + $(eval export DEPLOY_ENV=preview) + @true + +.PHONY: staging +staging: ## Set environment to staging + $(eval export DEPLOY_ENV=staging) + @true + +.PHONY: production +production: ## Set environment to production + $(eval export DEPLOY_ENV=production) + @true + .PHONY: cf-login cf-login: ## Log in to Cloud Foundry $(if ${CF_USERNAME},,$(error Must specify CF_USERNAME))