add make targets for some manage.py tasks
This commit is contained in:
parent
0fdf7029e4
commit
2e3be76e31
3 changed files with 18 additions and 2 deletions
15
Makefile
15
Makefile
|
|
@ -9,8 +9,9 @@ SERVER_LISTEN ?= 0.0.0.0:8042
|
|||
STAGE ?= production
|
||||
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
|
||||
.PHONY: run docker-build docker-run decrypt deploy log-show live-collectstatic live-migrate live-shell
|
||||
|
||||
# Default target: none
|
||||
all:
|
||||
|
|
@ -44,3 +45,15 @@ deploy:
|
|||
# Show logs for running container
|
||||
log-show:
|
||||
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 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue