-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
149 lines (102 loc) · 4.84 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
default: beer
.PHONY: beer fresh down build up install update unit integration ssh chrome drop-database create-database refresh migration entities yarn-install encore cs-fixer-dry cs-fixer php node cache translations diff selenium vnc cleanup-symfony-bundles sauce-chrome sauce-firefox stan fixtures travis-ruby dev sort docs
NGINX_WEB_PORT = 62337
MAILCATCHER_WEB_PORT = 62340
DOCS_WEB_PORT = 62342
RUN_COMMAND = docker run --rm --network beeriously_default --volume `pwd`:/app -v $(HOME)/.composer:/root/.composer --workdir /app
RUN_COMMAND_ON_PHP = $(RUN_COMMAND) --interactive --tty beeriously_php-fpm
RUN_COMMAND_ON_NODE = $(RUN_COMMAND) --interactive --tty beeriously_webpack
RUN_COMMAND_ON_NODE_NON_TTY = $(RUN_COMMAND) beeriously_webpack
travis-ruby:
docker run --rm --interactive --tty --network beeriously_default --volume `pwd`:/app -v $(HOME)/.composer:/root/.composer --workdir /app ruby:2.2 bash
# gem install travis -v 1.8.9 --no-rdoc --no-ri
beer: down cleanup-symfony-bundles build up install create-database run-migrations yarn-install encore
fresh: drop-database beer
down:
docker-compose down
cleanup-symfony-bundles:
rm -rf public/bundles/*
build:
docker-compose build
up:
docker-compose up -d
install:
$(RUN_COMMAND_ON_PHP) composer install
update:
$(RUN_COMMAND_ON_PHP) composer update
unit:
$(RUN_COMMAND_ON_PHP) /app/vendor/bin/phpunit --no-coverage --stop-on-failure --configuration /app/tests/Unit/phpunit.xml.dist
unit-with-coverage: clear-coverage
$(RUN_COMMAND_ON_PHP) /app/vendor/bin/phpunit --configuration /app/tests/Unit/phpunit.xml.dist
integration: refresh
$(RUN_COMMAND_ON_PHP) /app/vendor/bin/phpunit --no-coverage --stop-on-failure --configuration /app/tests/Integration/phpunit.xml.dist
integration-with-coverage: clear-coverage
$(RUN_COMMAND_ON_PHP) /app/vendor/bin/phpunit --configuration /app/tests/Integration/phpunit.xml.dist
coverage: clear-coverage unit-with-coverage integration-with-coverage
$(RUN_COMMAND_ON_PHP) /app/vendor/bin/phpcov merge /app/var/test/build/clover --html=/app/var/test/build/all/html --clover /app/var/test/build/all/clover
clear-coverage:
rm -rf var/test
mkdir var/test
mkdir var/test/build
mkdir var/test/build/clover
bash:
$(RUN_COMMAND_ON_PHP) bash
chrome:
open -a "Google Chrome" http://localhost:$(MAILCATCHER_WEB_PORT)/
open -a "Google Chrome" http://localhost:$(NGINX_WEB_PORT)/
translate:
open -a "Google Chrome" http://localhost:$(NGINX_WEB_PORT)/en/admin/_trans
drop-database:
docker-compose exec -u postgres postgres dropdb beeriously
create-database:
$(RUN_COMMAND_ON_PHP) /app/bin/console doctrine:database:create
run-migrations:
$(RUN_COMMAND_ON_PHP) /app/bin/console doctrine:migrations:migrate --no-interaction -v
refresh: drop-database create-database run-migrations
migration:
$(RUN_COMMAND_ON_PHP) /app/bin/console doctrine:migrations:generate
entities:
$(RUN_COMMAND_ON_PHP) /app/bin/console doctrine:mapping:convert annotation ./var/dev/Entity --from-database --force
yarn-install:
$(RUN_COMMAND_ON_NODE) yarn install
encore:
$(RUN_COMMAND_ON_NODE) yarn run encore dev
encore-non-tty:
$(RUN_COMMAND_ON_NODE_NON_TTY) yarn run encore dev
watch-assets:
fswatch -o assets/ | xargs -n1 ./run_encore.bash
cs-fixer-dry:
$(RUN_COMMAND_ON_PHP) vendor/bin/php-cs-fixer fix --diff --dry-run -v --using-cache=no
cs:
$(RUN_COMMAND_ON_PHP) vendor/bin/php-cs-fixer fix --using-cache=no
php:
@echo "$(RUN_COMMAND_ON_PHP)"
node:
@echo "$(RUN_COMMAND_ON_NODE)"
cache:
$(RUN_COMMAND_ON_PHP) /app/bin/console cache:clear --no-warmup
$(RUN_COMMAND_ON_PHP) /app/bin/console cache:warmup -vvv
translations:
$(RUN_COMMAND_ON_PHP) /app/bin/console translation:extract beeriously
diff:
$(RUN_COMMAND_ON_PHP) /app/bin/console doctrine:migrations:diff --filter-expression="/^(?!sessions)/"
selenium: refresh
$(RUN_COMMAND_ON_PHP) /app/vendor/bin/behat --config=/app/behat.docker-selenium.yml --colors
sauce-chrome: refresh
$(RUN_COMMAND_ON_PHP) /app/vendor/bin/behat --config=/app/behat.docker-saucelabs.yml --colors -p win-chrome
sauce-firefox: refresh
$(RUN_COMMAND_ON_PHP) /app/vendor/bin/behat --config=/app/behat.docker-saucelabs.yml --colors -p mac-firefox
vnc:
open vnc://localhost:62339
stan:
$(RUN_COMMAND_ON_PHP) /app/vendor/bin/phpstan analyse --level=max /app/src /app/tests
fixtures:
$(RUN_COMMAND_ON_PHP) /app/bin/console doctrine:fixtures:load --no-interaction -v
dev: fixtures
$(RUN_COMMAND_ON_PHP) /app/bin/console beeriously:development:setupDevUser
sort:
sort translations/messages.us.yml > translations/messages.us.yml.sort ; rm translations/messages.us.yml ; mv translations/messages.us.yml.sort translations/messages.us.yml
sort translations/messages.de.yml > translations/messages.de.yml.sort ; rm translations/messages.de.yml ; mv translations/messages.de.yml.sort translations/messages.de.yml
docs:
open -a "Google Chrome" http://localhost:$(DOCS_WEB_PORT)/
pre: sort cs stan