forked from gbourgeat/clean-architecture-apiplatform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (37 loc) · 1.08 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
DC = DOCKER_BUILDKIT=1 docker-compose
EXEC = $(DC) exec api_php
COMPOSER = $(EXEC) composer
php:
@$(EXEC) sh
install:
@$(MAKE) generate-localhost-certs
@$(MAKE) generate-jwt-keypair
@$(DC) build
@$(MAKE) start -s
@$(MAKE) vendor -s
@$(MAKE) db-reset -s
generate-localhost-certs:
sh generate-localhost-certs.sh
generate-jwt-keypair:
sh generate-jwt-keypair.sh
vendor:
@$(COMPOSER) install --optimize-autoloader
start:
@$(DC) up -d --remove-orphans --no-recreate
stop:
@$(DC) kill
@$(DC) rm -v --force
.PHONY: php install generate-localhost-certs generate-jwt-keypair vendor start stop
db-create:
@$(EXEC) bin/console doctrine:database:drop --force --if-exists -nq
@$(EXEC) bin/console doctrine:database:create -nq
db-update:
@$(EXEC) bin/console doctrine:schema:update --force -nq
db-reset: db-create db-update
.PHONY: db-create db-update db-reset
tests:
@$(EXEC) bin/console doctrine:database:drop --force --env=test || true
@$(EXEC) bin/console doctrine:database:create --env=test
@$(EXEC) bin/console doctrine:schema:create --env=test
@$(EXEC) bin/phpunit $@
.PHONY: tests