generated from CraftQuest/craft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
29 lines (27 loc) · 781 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
CONTAINER?=$(shell basename $(CURDIR))-php-1
.PHONY: dev clean composer craft nuke ssh up
dev: up
clean:
rm -f cms/composer.lock
rm -rf cms/vendor/
composer: up
docker exec -it ${CONTAINER} su-exec www-data composer \
$(filter-out $@,$(MAKECMDGOALS))
craft: up
docker exec -it ${CONTAINER} su-exec www-data php craft \
$(filter-out $@,$(MAKECMDGOALS))
nuke:
docker-compose down -v
rm -f cms/composer.lock
rm -rf cms/vendor/
docker-compose up --build --force-recreate
ssh: up
docker exec -it ${CONTAINER} su-exec www-data /bin/sh
up:
if [ ! "$$(docker ps -q -f name=${CONTAINER})" ]; then \
cp -n cms/example.env cms/.env; \
docker-compose up; \
fi
%:
@:
# ref: https://stackoverflow.com/questions/6273608/how-to-pass-argument-to-makefile-from-command-line