-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (47 loc) · 2.44 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
.DEFAULT_GOAL := help
include docker.env
ifeq ($(shell docker --help | grep "compose"),)
DOCKER_COMPOSE_ALIAS := docker-compose --env-file docker.env
else
DOCKER_COMPOSE_ALIAS := docker compose --env-file docker.env
endif
.PHONY: up
up: ## Start the development environment
$(DOCKER_COMPOSE_ALIAS) up -d
@echo "Connectez-vous à l’adresse http://localhost:$(PORT_WEB)"
up-build: ## Start the development environment by rebuilding the Docker images
$(DOCKER_COMPOSE_ALIAS) up -d --build
down: ## Shutdown the Docker containers
$(DOCKER_COMPOSE_ALIAS) down
down-v: ## Shutdown the Docker containers AND delete the volumes (including the database)
$(DOCKER_COMPOSE_ALIAS) down -v
bash: ## Open a bash on web with current user
$(DOCKER_COMPOSE_ALIAS) exec -u ${MY_UID}:${MY_GID} -it web /bin/bash
bash-root: ## open a bash on web with root user
$(DOCKER_COMPOSE_ALIAS) exec -u root -it web /bin/bash
migration: ## Install/update database
$(DOCKER_COMPOSE_ALIAS) exec web bin/console doctrine:migration:migrate --no-interaction
messenger-consume: ## Consume messenger messages
$(DOCKER_COMPOSE_ALIAS) exec web php bin/console messenger:consume async
.PHONY: symfony-lint
lint: ## Execute the linters
$(DOCKER_COMPOSE_ALIAS) exec web vendor/bin/phpstan --memory-limit=256M analyse src
$(DOCKER_COMPOSE_ALIAS) exec web vendor/bin/php-cs-fixer fix src --dry-run
#$(DOCKER_COMPOSE_ALIAS) exec web vendor/bin/rector process src --dry-run
$(DOCKER_COMPOSE_ALIAS) exec web php bin/console lint:container
$(DOCKER_COMPOSE_ALIAS) exec web php bin/console lint:twig templates
.PHONY: lint-fix
lint-fix: ## Execute php-cs-fixer and rector
$(DOCKER_COMPOSE_ALIAS) exec web vendor/bin/php-cs-fixer fix src
#$(DOCKER_COMPOSE_ALIAS) exec web vendor/bin/rector process src
make lint
ip-adresses: ## [host] get ip addresses of containers
# --- mysql ip
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' abris-non-gardes-mysql-1
symfony-install-core: ## Install Symfony framework core
$(DOCKER_COMPOSE_ALIAS) exec web composer create-project symfony/skeleton:"6.3.*" temp_directory && cp -r temp_directory/* . && cp temp_directory/.env . && rm -rf temp_directory
symfony-install-webapp: ## Install Symfony webapp
$(DOCKER_COMPOSE_ALIAS) exec web composer require webapp
.PHONY: help
help: ## Show this help
@grep -hE '^[A-Za-z0-9_ \-]*?:.*##.*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'