-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
107 lines (82 loc) · 2.41 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
97
98
99
100
101
102
103
104
105
106
107
-include .env
STAGE ?= dev
CI ?= 0
####################
# STACK MANAGEMENT #
####################
.PHONY: build
build:
docker-compose build
.PHONY: start
start:
docker-compose up -d --remove-orphans
.PHONY: stop
stop:
docker-compose stop
.PHONY: kill
kill:
docker-compose down
#######
# API #
#######
.PHONY: api-acceptance
api-acceptance:
@docker exec -it "$$(docker ps -q -f name=chatterer_api)" vendor/bin/behat
.PHONY: api-integrations
api-integrations:
@docker-compose run --rm --no-deps api kahlan
.PHONY: api-shell
api-shell:
@docker exec -it "$$(docker ps -q -f name=chatterer_api)" sh
.PHONY: api-specs
api-specs:
@docker-compose run --rm --no-deps api phpspec run -f pretty -vn --no-code-generation
.PHONY: api-setup-db-test
api-setup-db-test:
@docker-compose run --rm --no-deps api console doctrine:database:create --env=test --if-not-exists
@docker-compose run --rm --no-deps api console doctrine:migrations:migrate -n --env=test
.PHONY: api-fixtures
api-fixtures:
@docker-compose run --rm --no-deps api console app:data:fixtures -p
.PHONY: api-vendor
api-vendor:
@docker-compose run --rm --no-deps api composer install
##########
# CLIENT #
##########
.PHONY: client-shell
client-shell:
@docker exec -it "$$(docker ps -q -f name=chatterer_client)" sh
.PHONY: client-install
client-install:
@docker-compose run --rm --no-deps client npm install
.PHONY: client-build
client-build:
@docker-compose run --rm --no-deps client npm run build
.PHONY: client-test
client-test:
@docker-compose run --rm --no-deps client npm run test --verbose
############
# DATABASE #
############
.PHONY: database-connect
database-connect:
@docker-compose run --rm database mysql -u ${MYSQL_USER} -p
#########
# TOOLS #
#########
.PHONY: phpstan
phpstan:
docker-compose -f docker-compose.tools.yaml build phpstan > /dev/null
docker-compose -f docker-compose.tools.yaml run --rm --user=$$(id -u) -w /code --entrypoint=sh phpstan -c "composer install $(COMPOSER_OPTIONS)"
ifeq ($(CI),1)
docker-compose -f docker-compose.tools.yaml run --rm --user=$$(id -u) -w /code --entrypoint=sh phpstan -c "phpstan analyse --memory-limit=-1 --error-format=raw --no-progress -v"
else
docker-compose -f docker-compose.tools.yaml run --rm --user=$$(id -u) -w /code --entrypoint=sh phpstan -c "phpstan analyse --memory-limit=-1"
endif
#################
# MISCELLANEOUS #
#################
.env:
cp -n .env.dist .env
cp -n apps/api/.env.dist apps/api/.env