From 11e52bcb27798ac0a0d64711f72bc89d49e0d6d8 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Fri, 6 Aug 2021 11:14:03 +0000 Subject: [PATCH] [TOOLS] Add utility commands to the Makefile --- Makefile | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index bbba90ad8a..69c320cf22 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,25 @@ +DIR=$(strip $(notdir $(CURDIR))) # Seems a bit hack-ish, but `basename` works differently -test: +.PHONY: + if ! docker info > /dev/null; then echo "Docker does not seem to be running"; exit 1; fi + +up: .PHONY + docker-compose up -d + +down: .PHONY + docker-compose down + +php-repl: .PHONY + docker exec -it $(strip $(DIR))_php_1 sh -c '/var/www/social/bin/console psysh' + +php-shell: .PHONY + docker exec -it $(strip $(DIR))_php_1 sh -c 'cd /var/www/social; sh' + +psql-shell: .PHONY + docker exec -it $(strip $(DIR))_db_1 sh -c "psql -U postgres social" + +test: .PHONY cd docker/testing && docker-compose run php && docker-compose down -stop-test: +stop-test: .PHONY cd docker/testing && docker-compose down