-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile-backend
73 lines (58 loc) · 2.23 KB
/
Makefile-backend
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
65
66
67
68
69
70
71
72
73
BACKEND_ROOT = www/api
BACKEND_DEPENDENCIES_MARK = $(BACKEND_ROOT)/vendor/.built
BACKEND_BUILT_MARK = $(BACKEND_DEPENDENCIES_MARK)
backend: clear backend-dump backend-dependencies backend-test lint ok
backend-full: clear clean-files dc-build dc-up backend-dump backend-dependencies backend-test ok
.PHONY: backend-clean
backend-clean: backend-clean-files
rm -fr "$(ROOT)/$(BACKEND_ROOT)/vendor"
rm -fr "$(ROOT)/$(BACKEND_DEPENDENCIES_MARK)"
.PHONY: backend-clean-files
clean-files: backend-clean-files
backend-clean-files:
rm -fr "$(ROOT)/$(BACKEND_ROOT)/bootstrap/cache"
rm -fr "$(ROOT)/live/laravel"
rm -fr "$(ROOT)/$(TMP)/backend"
.PHONY: backend-dump
dump: backend-dump
backend-dump:
@echo ""
@echo "***************"
@echo "*** Backend ***"
@echo ""
@echo "BACKEND_ROOT: $(BACKEND_ROOT)"
@echo "BACKEND_DEPENDENCIES_MARK: $(BACKEND_DEPENDENCIES_MARK)"
# @echo "PHP: $(shell bin/cr-php -r 'echo PHP_VERSION;' 2>&1 )"
# @echo "PHP composer: $(shell bin/cr-composer --version 2>&1 )"
# %/composer.lock: %/composer.json
# bin/composer install --working-dir "$(dir $@)"
# touch "$@"
.PHONY: backend-dependencies
dependencies: backend-dependencies
backend-dependencies: $(BACKEND_DEPENDENCIES_MARK)
$(BACKEND_DEPENDENCIES_MARK): \
$(BACKEND_ROOT)/composer.lock
cr-ensure-folder-empty $(BACKEND_ROOT)/bootstrap/cache
bin/cr-composer install --working-dir "$(BACKEND_ROOT)"
@mkdir -p "$(dir $@)"
@touch "$@"
$(BACKEND_ROOT)/composer.lock: $(BACKEND_ROOT)/composer.json
bin/cr-composer update --no-install --working-dir "$(BACKEND_ROOT)"
@touch "$@"
.PHONY: backend-update-dependencies
update: backend-update-dependencies
backend-update-dependencies:
cr-ensure-folder-empty $(BACKEND_ROOT)/bootstrap/cache
bin/cr-composer update --working-dir "$(BACKEND_ROOT)"
.PHONY: backend-test
test: backend-test
backend-test: $(BACKEND_DEPENDENCIES_MARK)
cd "$(BACKEND_ROOT)" && $(ROOT)/bin/cr-phpunit
.PHONY: backend-update-references
update: backend-update-references
backend-update-references: $(BACKEND_DEPENDENCIES_MARK)
cd "$(BACKEND_ROOT)" && COMMIT=1 $(ROOT)/bin/cr-phpunit
.PHONY: backend-github
github: backend-github
backend-github:
chmod --changes a+x www/api/vendor/bin/*