Skip to content

Commit 63a78c1

Browse files
committed
New make actions: drush and logs
1 parent b11904c commit 63a78c1

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

docker.mk

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
include .env
22

3-
.PHONY: up down stop prune ps shell
3+
.PHONY: up down stop prune ps shell drush logs
44

55
default: up
66

7+
DRUPAL_ROOT ?= /var/www/html/web
8+
79
up:
810
@echo "Starting up containers for $(PROJECT_NAME)..."
911
docker-compose pull --parallel
@@ -24,3 +26,13 @@ ps:
2426

2527
shell:
2628
docker exec -ti $(shell docker ps --filter name='$(PROJECT_NAME)_php' --format "{{ .ID }}") sh
29+
30+
drush:
31+
docker exec $(shell docker ps --filter name='$(PROJECT_NAME)_php' --format "{{ .ID }}") drush -r $(DRUPAL_ROOT) $(filter-out $@,$(MAKECMDGOALS))
32+
33+
logs:
34+
@docker-compose logs -f $(filter-out $@,$(MAKECMDGOALS))
35+
36+
# https://stackoverflow.com/a/6273809/1826109
37+
%:
38+
@:

0 commit comments

Comments
 (0)