-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
64 lines (55 loc) · 1.94 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
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
.DEFAULT_GOAL := help
IS_DOCKER := $(shell [ -f /.dockerenv ] && echo true)
.PHONY: requirements
requirements: ## Install requirements
npm ci --no-audit --no-fund
.PHONY: full
full: requirements ## Build full environment (will destroy existing data)
ifdef IS_DOCKER
@echo "Error: This Makefile should not be run inside a Docker container."
@exit 1
endif
docker compose build --no-cache --pull
docker compose up --detach --remove-orphans --force-recreate --build && sleep 3
docker exec --interactive --tty --user devilbox php sh -c ' \
node build --all; \
(cd src/files/client/custom/modules/dubas-light-theme; npm ci); \
'
.PHONY: package
package: requirements ## Build extension package
( \
cd src/files/client/custom/modules/dubas-light-theme; \
npm ci; \
mkdir --parents /tmp/dubas-light-theme; \
mv Gruntfile.js package-lock.json package.json frontend node_modules /tmp/dubas-light-theme; \
)
node build --extension
mv /tmp/dubas-light-theme/* src/files/client/custom/modules/dubas-light-theme
.PHONY: copy
copy: ## Copy extension
( \
cd src/files/client/custom/modules/dubas-light-theme; \
grunt; \
mkdir --parents /tmp/dubas-light-theme; \
mv Gruntfile.js package-lock.json package.json frontend node_modules /tmp/dubas-light-theme; \
)
node build --copy
mv /tmp/dubas-light-theme/* src/files/client/custom/modules/dubas-light-theme
.PHONY: cc
cc: copy ## Copy extension and clear cache
docker exec --interactive --tty --user devilbox php sh -c ' \
cd site; php clear_cache.php \
'
.PHONY: cr
cr: copy ## Copy extension and rebuild
docker exec --interactive --tty --user devilbox php sh -c ' \
cd site; php rebuild.php; \
'
.PHONY: clean
clean: ## Clean up
docker compose down --volumes --remove-orphans
rm --recursive --force ./site
git clean -fdX
.PHONY: help
help: ## Display this help screen
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'