-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (47 loc) · 2.26 KB
/
Copy pathMakefile
File metadata and controls
59 lines (47 loc) · 2.26 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
### ——————————————————————————————————————————————————————————————————
### —— Local Makefile
### ——————————————————————————————————————————————————————————————————
include splash/vendor/badpixxel/php-sdk/make/sdk.mk
################################################################################
# Docker Compose Container we want to check
CONTAINERS="dol-23,dol-22,dol-21,dol-20,dol-18,dol-17,dol-16"
COMMAND ?= echo "Aucune commande spécifiée"
COLOR_CYAN := $(shell tput setaf 6)
COLOR_RESET := $(shell tput sgr0)
.PHONY: serve
serve: ## Execute Functional Test
symfony serve --no-tls
.PHONY: upgrade
upgrade: ## Update Composer Packages
composer update -q || composer update
.PHONY: verify
verify: ## Verify Code in All Containers
$(MAKE) up
$(MAKE) upgrade
$(MAKE) all-checked COMMAND="php splash/vendor/bin/grumphp run --testsuite=travis"
$(MAKE) all-checked COMMAND="php splash/vendor/bin/grumphp run --testsuite=csfixer"
$(MAKE) all-checked COMMAND="php splash/vendor/bin/grumphp run --testsuite=phpstan"
.PHONY: phpstan
phpstan: ## Execute Php Stan in All Containers
$(MAKE) all-checked COMMAND="php splash/vendor/bin/grumphp run --testsuite=phpstan"
.PHONY: test
test: ## Execute Functional Test in All Containers
$(MAKE) up
$(MAKE) all-checked COMMAND="php splash/vendor/bin/phpunit --testdox"
.PHONY: module
module: ## Build Slash Module
php splash/vendor/bin/grumphp run --tasks=build-module
.PHONY: all
all: ## Execute a Command in All Containers
@$(foreach service,$(shell docker compose config --services | sort), \
set -e; \
echo "$(COLOR_CYAN) >> Executing '$(COMMAND)' in container: $(service) $(COLOR_RESET)"; \
docker compose exec $(service) bash -c "$(COMMAND)"; \
)
.PHONY: all-checked
all-checked: ## Execute a Command in All Checked Containers
@$(foreach service,$(shell echo $(CONTAINERS) | tr "," "\n"), \
set -e; \
echo "$(COLOR_CYAN) >> Executing '$(COMMAND)' in container: $(service) $(COLOR_RESET)"; \
docker compose exec $(service) bash -c "$(COMMAND)"; \
)