forked from hove-io/NavitiaComponent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (28 loc) · 1.37 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
##
## Help
##
.PHONY: help
help: ## Prints this help message
@grep -E '^[a-zA-Z_-]+:.*## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
##
## Run tests
##
end_tests: ## Clean only container
_UID=$(shell id -u) GID=$(shell id -g) docker-compose -p "navitiacomponent_$(shell git rev-parse --abbrev-ref HEAD)" -f docker-compose.test.yml down --remove-orphans
clean_tests: ## Clean all
@ echo "\033[0;32mCleaning\033[0m"
@$(MAKE) end_tests
@ rm composer.lock; rm -rf vendor
build_tests: ## Build image and vendor
_UID=$(shell id -u) GID=$(shell id -g) docker-compose -p "navitiacomponent_$(shell git rev-parse --abbrev-ref HEAD)" -f docker-compose.test.yml build
_UID=$(shell id -u) GID=$(shell id -g) docker-compose -p "navitiacomponent_$(shell git rev-parse --abbrev-ref HEAD)" -f docker-compose.test.yml run --rm --no-deps navitiacomponent composer install --no-interaction --prefer-source
start_tests: ## Start phpunit tests
_UID=$(shell id -u) GID=$(shell id -g) docker-compose -p "navitiacomponent_$(shell git rev-parse --abbrev-ref HEAD)" -f docker-compose.test.yml run --rm navitiacomponent
all_tests_dev: ## Start all tests and clean only container
@$(MAKE) build_tests
@$(MAKE) start_tests
@$(MAKE) end_tests
all_tests: ## Start all tests and clean all
@$(MAKE) build_tests
@$(MAKE) start_tests
@$(MAKE) clean_tests