This repository has been archived by the owner on Sep 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
96 lines (68 loc) · 3.05 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
DOCKER = docker
DOCKER_COMPOSE = docker-compose
##
## ----------------------------------------------------------------------------
## Environment
## ----------------------------------------------------------------------------
##
build: ## Build the environment
$(DOCKER_COMPOSE) build
install: ## Install the environment
make build start composer yarn encore-prod
open http://ocommerce.dev.fr
logs: ## Follow logs generated by all containers
$(DOCKER_COMPOSE) logs -f --tail=0
logs-full: ## Follow logs generated by all containers from the containers creation
$(DOCKER_COMPOSE) logs -f
ps: ## List all containers managed by the environment
$(DOCKER_COMPOSE) ps
restart: ## Restart the environment
$(DOCKER_COMPOSE) restart
start: ## Start the environment
$(DOCKER_COMPOSE) up -d --remove-orphans
stats: ## Print real-time statistics about containers ressources usage
$(DOCKER) stats $($(DOCKER) ps --format={{.Names}})
stop: ## Stop the environment
$(DOCKER_COMPOSE) stop
uninstall: ## Uninstall the environment
$(DOCKER_COMPOSE) kill
$(DOCKER_COMPOSE) down --volumes --remove-orphans
.PHONY: build install logs logs-full ps restart start stats stop uninstall
##
## ----------------------------------------------------------------------------
## Project
## ----------------------------------------------------------------------------
##
composer: ## Install Composer dependencies from the "php" container
$(DOCKER_COMPOSE) exec php sh -c "composer install --optimize-autoloader"
encore-dev: ## Compile assets once with Encore/Webpack
$(DOCKER_COMPOSE) exec php sh -c "yarn run encore dev"
encore-prod: ## Compile assets once with Encore/Webpack and minify & optimize them
$(DOCKER_COMPOSE) exec php sh -c "yarn run encore production"
encore-watch: ## Compile assets automatically with Encore/Webpack when files change
$(DOCKER_COMPOSE) exec php sh -c "yarn run encore dev --watch"
schema-update: ## Update mysql database
$(DOCKER_COMPOSE) exec php bin/console d:s:u --force
entity-regenerate: ## entity generate getter & setter
$(DOCKER_COMPOSE) exec php bin/console make:entity --regenerate App
entity: ## create/update entity
$(DOCKER_COMPOSE) exec php bin/console make:entity
fix: ## phpcs
$(DOCKER_COMPOSE) exec php vendor/friendsofphp/php-cs-fixer/php-cs-fixer fix src/
analyse: ## analyse code with php stan
$(DOCKER_COMPOSE) exec php vendor/bin/phpstan analyse --level max src/
nginx: ## Open a terminal in the "nginx" container
$(DOCKER_COMPOSE) exec nginx sh
php: ## Open a terminal in the "php" container
$(DOCKER_COMPOSE) exec php bash
yarn: ## Install Yarn dependencies from the "php" container"
$(DOCKER_COMPOSE) exec php sh -c "yarn install"
watch: ## Install Yarn dependencies from the "php" container"
$(DOCKER_COMPOSE) exec php sh -c "yarn install"
.PHONY: composer encore-dev encore-prod encore-watch nginx php yarn watch
.DEFAULT_GOAL := help
help:
@grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' \
| sed -e 's/\[32m##/[33m/'
.PHONY: help