This repository was archived by the owner on Feb 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (62 loc) · 2.01 KB
/
Makefile
File metadata and controls
64 lines (62 loc) · 2.01 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
CONTAINER?=$(shell basename $(CURDIR)| tr A-Z a-z)_php_1
DBCONTAINER?=$(shell basename $(CURDIR)| tr A-Z a-z)_mysql_1
BUILDCHAIN?=$(shell basename $(CURDIR)| tr A-Z a-z)_webpack_1
.PHONY: build clean composer craft dev npm fixdb pulldb restoredb nuke ssh update update-clean up
build: up
docker exec -it ${BUILDCHAIN} npm run build
clean:
docker-compose down -v
docker-compose up --build
composer: up
docker exec -it ${CONTAINER} composer \
$(filter-out $@,$(MAKECMDGOALS))
craft: up
docker exec -it ${CONTAINER} php craft \
$(filter-out $@,$(MAKECMDGOALS))
dev: up
npm: up
docker exec -it ${BUILDCHAIN} npm \
$(filter-out $@,$(MAKECMDGOALS))
fixdb: up
docker exec -it ${DBCONTAINER} mysql -uroot -psecret -Bse "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';ALTER USER 'project'@'%' IDENTIFIED WITH mysql_native_password BY 'project';"
pulldb: up
cd scripts/ && ./docker_pull_db.sh
restoredb: up
cd scripts/ && ./docker_restore_db.sh \
$(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} /bin/sh
update:
docker-compose down
rm -f cms/composer.lock
rm -f buildchain/package-lock.json
docker-compose up
update-clean:
docker-compose down
rm -f cms/composer.lock
rm -rf cms/vendor/
rm -f buildchain/package-lock.json
rm -rf buildchain/node_modules/
docker-compose up
up:
if [ ! "$$(docker ps -q -f name=${CONTAINER})" ]; then \
cp -n cms/.env.example cms/.env; \
chmod 0777 cms/.env; \
chmod 0777 cms/composer.json; \
chmod -f 0777 cms/composer.lock || true; \
chmod 0777 cms/config; \
chmod -R 0777 cms/config/project; \
chmod -f 0777 cms/config/license.key || true; \
chmod -R 0777 cms/storage; \
chmod -R 0777 cms/vendor; \
chmod -R 0777 cms/web/cpresources; \
docker-compose up; \
fi
%:
@:
# ref: https://stackoverflow.com/questions/6273608/how-to-pass-argument-to-makefile-from-command-line