From 63a78c1edadd9879f8a78e6d0aaf22e78ffe8817 Mon Sep 17 00:00:00 2001 From: Chingis Sandanov Date: Thu, 29 Mar 2018 12:12:15 +0700 Subject: [PATCH] New make actions: drush and logs --- docker.mk | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docker.mk b/docker.mk index dc1b04caa..d131cc134 100644 --- a/docker.mk +++ b/docker.mk @@ -1,9 +1,11 @@ include .env -.PHONY: up down stop prune ps shell +.PHONY: up down stop prune ps shell drush logs default: up +DRUPAL_ROOT ?= /var/www/html/web + up: @echo "Starting up containers for $(PROJECT_NAME)..." docker-compose pull --parallel @@ -24,3 +26,13 @@ ps: shell: docker exec -ti $(shell docker ps --filter name='$(PROJECT_NAME)_php' --format "{{ .ID }}") sh + +drush: + docker exec $(shell docker ps --filter name='$(PROJECT_NAME)_php' --format "{{ .ID }}") drush -r $(DRUPAL_ROOT) $(filter-out $@,$(MAKECMDGOALS)) + +logs: + @docker-compose logs -f $(filter-out $@,$(MAKECMDGOALS)) + +# https://stackoverflow.com/a/6273809/1826109 +%: + @: \ No newline at end of file