From 4caa2165482be76bf430eb9bb5200dbb06e81fad Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Mon, 21 Oct 2019 02:32:51 +0200 Subject: [PATCH] add make target 'deploy-full'; reorder Makefile --- Makefile | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 2ba5dd4..770c3d9 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ GIT_CRYPT_KEY ?= ~/.git-crypt-keys/$(APP_NAME)-$(STAGE).key DOCKER_COMPOSE_YML := .deployment/$(STAGE)/docker-compose.yml APP_CONTAINER_NAME := django -.PHONY: run docker-build docker-run decrypt deploy log-show live-collectstatic live-migrate live-shell +.PHONY: run docker-build docker-run decrypt deploy deploy-full live-log live-migrate live-collectstatic live-shell # Default target: none all: @@ -38,22 +38,25 @@ docker-run: decrypt: git-crypt unlock $(GIT_CRYPT_KEY) +# Meta target for deploying: docker-compose up, migrate and collectstatic +deploy-full: deploy live-migrate live-collectstatic + # Deploy on production using docker-compose deploy: docker-compose -f $(DOCKER_COMPOSE_YML) up --build --detach # Show logs for running container -log-show: +live-log: docker-compose -f $(DOCKER_COMPOSE_YML) logs -f -# Run django 'collectstatic' command on live container -live-collectstatic: - docker-compose -f $(DOCKER_COMPOSE_YML) exec ${APP_CONTAINER_NAME} manage.py collectstatic --no-input --clear +# Run shell in live container +live-shell: + docker-compose -f $(DOCKER_COMPOSE_YML) exec ${APP_CONTAINER_NAME} sh # Run django 'migrate' command on live container live-migrate: docker-compose -f $(DOCKER_COMPOSE_YML) exec ${APP_CONTAINER_NAME} manage.py migrate --no-input -# Run shell in live container -live-shell: - docker-compose -f $(DOCKER_COMPOSE_YML) exec ${APP_CONTAINER_NAME} sh +# Run django 'collectstatic' command on live container +live-collectstatic: + docker-compose -f $(DOCKER_COMPOSE_YML) exec ${APP_CONTAINER_NAME} manage.py collectstatic --no-input --clear