forked from craftcms/spoke-and-chain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (30 loc) · 1.02 KB
/
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
30
31
32
DUMPFILE ?= seed.sql
COMPOSE ?= docker-compose
EXEC ?= ${COMPOSE} exec -T web
RUN ?= ${COMPOSE} run --rm web
WEB_CONTAINER = docker-compose ps -q web
.PHONY: init update restore backup seed clean test
init:
cp .env.docker .env
${COMPOSE} up -d
${EXEC} composer install
update:
${EXEC} composer update --no-interaction
${EXEC} php craft up --interactive=0
${EXEC} php craft queue/run --interactive=0
${EXEC} php craft gc --delete-all-trashed --interactive=0
restore:
${EXEC} php craft db/restore ${DUMPFILE}
backup:
${EXEC} php craft db/backup ${DUMPFILE} --overwrite --interactive=0
docker cp $(shell ${WEB_CONTAINER}):/app/composer.lock ./
docker cp $(shell ${WEB_CONTAINER}):/app/seed.sql ./
docker cp $(shell ${WEB_CONTAINER}):/app/config/project ./config/
seed:
${EXEC} php craft demos/seed
clean:
${EXEC} php craft demos/seed/clean
test:
${EXEC} curl -IX GET --fail http://localhost:8080/actions/app/health-check
${EXEC} curl -IX GET --fail http://localhost:8080/
update_and_reseed: init restore update clean seed backup