-
Notifications
You must be signed in to change notification settings - Fork 54
/
Makefile
102 lines (77 loc) · 3.07 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
.PHONY: all build phpcpd phploc phpmd php-cs-fixer php-code-sniffer phpmetrics phpunit infection behat version
export COMPOSER_MEMORY_LIMIT := -1
SRC_DIR=src tests
SRC_DIR_NO_TESTS=src
null :=
SPACE := $(null) $(null)
COMMA := ,
SRC_DIR_COMMA := $(subst $(SPACE),$(COMMA),$(SRC_DIR))
TIME_STAMP := $(shell git log -n 1 --format=%aI)
all: phpci
phpci: phpcpd phploc phpmd php-code-sniffer phpunit infection behat version
install:
git rev-parse --short HEAD > VERSION
test -f docker-compose.override.yml || cp docker-compose.override.yml.dist docker-compose.override.yml
curl https://downloads.bewelcome.org/for_developers/rox_test_db/languages.sql.bz2 -o ./docker/db/languages.sql.bz2
curl https://downloads.bewelcome.org/for_developers/rox_test_db/words.sql.bz2 -o ./docker/db/words.sql.bz2
bunzip2 --force ./docker/db/languages.sql.bz2 ./docker/db/words.sql.bz2
ifdef root
sudo docker-compose up -d
else
docker-compose up -d
endif
install-geonames:
curl http://download.geonames.org/export/dump/allCountries.zip > docker/db/allCountries.zip
curl http://download.geonames.org/export/dump/alternateNames.zip > docker/db/alternateNames.zip
curl http://download.geonames.org/export/dump/countryInfo.txt > docker/db/countryInfo.txt
unzip docker/db/allCountries.zip -d docker/db/
unzip docker/db/alternateNames.zip -d docker/db/
rm docker/db/*.zip
ifdef root
sudo docker-compose exec php sh -c "mysql bewelcome -u bewelcome -pbewelcome -h db < import.sql"
else
docker-compose exec php sh -c "mysql bewelcome -u bewelcome -pbewelcome -h db < import.sql"
endif
phpcsfix:
"./vendor/bin/phpcbf" $(SRC_DIR)
"./vendor/bin/php-cs-fixer" fix -v
deploy: composer yarn encore assets
composer:
composer install --prefer-dist --no-progress --no-suggest --no-interaction --no-scripts
yarn:
yarn install
encore:
yarn encore production
assets:
php bin/console assets:install --env=prod
build:
yarn encore dev
php bin/console assets:install
phpdox: phploc phpmd php-code-sniffer phpunit
"./vendor/bin/phpdox"
mkdocs:
mkdocs build
phpcpd:
"./vendor/bin/phpcpd" $(SRC_DIR_NO_TESTS) --exclude=src/Entity
phploc:
"./vendor/bin/phploc" --log-xml=phploc.xml $(SRC_DIR)
phpmd:
"./vendor/bin/phpmd" $(SRC_DIR_COMMA) text phpmd.xml
php-cs-fixer:
"./vendor/bin/php-cs-fixer" fix -v --diff --dry-run
php-code-sniffer:
"./vendor/bin/phpcs" --colors --warning-severity=Error
phpunit:
phpdbg -qrr bin/phpunit --coverage-xml=build/logs/phpunit/coverage-xml --coverage-clover=build/logs/phpunit/clover.xml --log-junit=build/logs/phpunit/junit.xml --colors=never
infection: phpunit
"./vendor/bin/infection" --only-covered --coverage=build/logs/phpunit --min-covered-msi=85 --threads=30
behat: encore
bin/console doctrine:database:create --env=test --if-not-exists
bin/console doctrine:schema:create --env=test
bin/console hautelook:fixtures:load --env=test --no-interaction
vendor/bin/behat --colors --tags='~@wip'
phpmetrics:
"./vendor/bin/phpmetrics" --exclude=src/App/Entity --report-violations=phpmetrics.xml $(SRC_DIR_COMMA)
version:
git rev-parse --short HEAD > VERSION
touch -d $(TIME_STAMP) VERSION