-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (59 loc) · 1.93 KB
/
Makefile
File metadata and controls
76 lines (59 loc) · 1.93 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
include .env
# Include local.env file if it exists
ifneq ("$(wildcard .env.local)","")
include .env.local
endif
# CONSOLE COLORS (Red, Green, Blue, Yellow, Default)
R = \033[0;31m
LR = \033[1;31m
G = \033[0;32m
LG = \033[1;32m
B = \033[0;36m
LB = \033[1;36m
Y = \033[0;33m
LY = \033[1;33m
D = \033[0m
bash:
@docker-compose exec -it php bash
cache:
@docker-compose exec php bin/console cache:clear
composer-install:
@docker-compose exec php composer install
composer-dump:
@docker-compose exec php composer dump-autoload
init:
@$(MAKE) -s composer-install
@$(MAKE) -s migrations-migrate
kill:
@echo "${LR}Brutally murdering all Docker containers...${D}"
@docker stop $(shell docker ps -qa)
@docker rm $(shell docker ps -qa)
migrations-schema:
@docker-compose exec php bin/console doctrine:schema:update --force
migrations-migrate:
@docker-compose exec php bin/console doctrine:migrations:migrate --no-interaction
router:
@docker-compose exec php bin/console debug:router
restart:
@$(MAKE) -s stop
@$(MAKE) -s start
start:
@echo "${LY}Starting Docker Localhost with build${D}"
@docker-compose up -d --build
stop:
@echo "${LY}Stopping Docker Localhost${D}"
@docker-compose down --remove-orphans
test:
@echo "${LY}Running tests... We must all face the choice between what is right and what is easy.${D}"
@docker-compose exec php bin/console doctrine:database:drop --force --env=test
@docker-compose exec php bin/console doctrine:database:create --env=test
@docker-compose exec php bin/console doctrine:migrations:migrate --no-interaction --env=test
@docker-compose exec php vendor/bin/phpunit --colors=always --testdox
## FIX WSL FILE PERMISSIONS
CURRENT_GROUP_ID := $(shell id -g)
fix-permission:
@echo -e "\n${LB}// Fix project file permissions${D}"
@echo -e "${LY}// change group for all files to ${CURRENT_GROUP_ID}${D}"
sudo chown -R :${CURRENT_GROUP_ID} *
@echo -e "${LY}// allow group to write${D}"
sudo chmod g+w -R *