Skip to content

Commit

Permalink
Add make commands: wp and logs
Browse files Browse the repository at this point in the history
  • Loading branch information
csandanov committed Mar 29, 2018
1 parent ee2966c commit 37e7682
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions docker.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
include .env

.PHONY: up down stop prune ps shell
.PHONY: up down stop prune ps shell wp logs

default: up

WP_ROOT ?= /var/www/html/

up:
@echo "Starting up containers for for $(PROJECT_NAME)..."
docker-compose pull --parallel
Expand All @@ -23,4 +25,14 @@ ps:
@docker ps --filter name='$(PROJECT_NAME)*'

shell:
docker exec -ti $(shell docker ps --filter name='$(PROJECT_NAME)_php' --format "{{ .ID }}") sh
docker exec -ti $(shell docker ps --filter name='$(PROJECT_NAME)_php' --format "{{ .ID }}") sh

wp:
docker exec $(shell docker ps --filter name='$(PROJECT_NAME)_php' --format "{{ .ID }}") wp --path=$(WP_ROOT) $(filter-out $@,$(MAKECMDGOALS))

logs:
@docker-compose logs -f $(filter-out $@,$(MAKECMDGOALS))

# https://stackoverflow.com/a/6273809/1826109
%:
@:

0 comments on commit 37e7682

Please sign in to comment.