forked from ruflin/Elastica
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
117 lines (92 loc) · 3.59 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
# Default version to start ES on Docker, overide with `ES_VERSION=75 make start-docker` for ES 7.5
ES_VERSION?=73
.PHONY: clean
clean:
rm -fr tools vendor build composer.lock .php_cs.cache
tools/phive.phar:
mkdir tools; \
wget --no-clobber --output-document=tools/phive.phar "https://phar.io/releases/phive.phar" --quiet; \
wget --no-clobber --output-document=tools/phive.phar.asc "https://phar.io/releases/phive.phar.asc" --quiet; \
gpg --keyserver hkps.pool.sks-keyservers.net --recv-keys 0x9D8A98B29B2D5D79; \
gpg --verify tools/phive.phar.asc tools/phive.phar; \
rm tools/phive.phar.asc; \
chmod +x tools/phive.phar;
vendor/autoload.php:
# Installing Symfony Flex: parallel download of dependency libs
composer global require --no-progress --no-scripts --no-plugins symfony/flex
composer install --prefer-dist --no-interaction ${COMPOSER_FLAGS}
tools/phpunit.phar tools/php-cs-fixer.phar: tools/phive.phar
tools/phive.phar install --copy --trust-gpg-keys 0xE82B2FB314E9906E,0x4AA394086372C20A
.PHONY: install-phpcs
install-phpcs: tools/php-cs-fixer.phar
.PHONY: install-phpunit
install-phpunit: tools/phpunit.phar
.PHONY: composer-install
composer-install: vendor/autoload.php
.PHONY: composer-update
composer-update:
composer update --prefer-dist --no-interaction ${COMPOSER_FLAGS}
.PHONY: install-tools
install-tools: install-phpcs install-phpunit
.PHONY: run-phpcs
run-phpcs: composer-install install-phpcs
tools/php-cs-fixer.phar fix --dry-run --allow-risky=yes -v
.PHONY: fix-phpcs
fix-phpcs: composer-install install-phpcs
tools/php-cs-fixer.phar fix --allow-risky=yes -v
.PHONY: run-phpunit
run-phpunit: composer-install install-phpunit
tools/phpunit.phar ${PHPUNIT_OPTIONS}
.PHONY: run-phpunit-coverage
run-phpunit-coverage: composer-install install-phpunit
EXIT_STATUS=0 ; \
tools/phpunit.phar --coverage-clover build/coverage/unit-coverage.xml --group unit || EXIT_STATUS=$$? ; \
tools/phpunit.phar --coverage-clover build/coverage/functional-coverage.xml --group functional || EXIT_STATUS=$$? ; \
exit $$EXIT_STATUS
.PHONY: run-coveralls
run-coveralls:
tools/php-coveralls.phar -v
tools/phpdocumentor.phar:
curl https://gitreleases.dev/gh/phpDocumentor/phpDocumentor/latest/phpDocumentor.phar -o tools/phpdocumentor.phar --silent -L; \
chmod +x tools/phpdocumentor.phar
.PHONY: run-phpdoc
run-phpdoc: tools/phpdocumentor.phar
tools/phpdocumentor.phar --directory=lib --target=build/docs --template=clean
##
## Docker commands
##
.PHONY: docker-start
docker-start:
docker-compose --file=docker/docker-compose.yml \
--file=docker/docker-compose.proxy.yml \
--file=docker/docker-compose.es.yml \
--file=docker/docker-compose.es${ES_VERSION}.yml \
up ${DOCKER_OPTIONS}
.PHONY: docker-stop
docker-stop:
docker-compose --file=docker/docker-compose.yml \
--file=docker/docker-compose.proxy.yml \
--file=docker/docker-compose.es.yml \
--file=docker/docker-compose.es${ES_VERSION}.yml \
down
.PHONY: docker-run-phpunit
docker-run-phpunit:
docker exec -ti 'elastica_php' env TERM=xterm-256color make run-phpunit PHPUNIT_OPTIONS=${PHPUNIT_OPTIONS}
.PHONY: docker-run-phpcs
docker-run-phpcs:
docker exec -ti 'elastica_php' env TERM=xterm-256color make run-phpcs
.PHONY: docker-fix-phpcs
docker-fix-phpcs:
docker exec -ti 'elastica_php' env TERM=xterm-256color make fix-phpcs
.PHONY: docker-shell
docker-shell:
docker exec -ti 'elastica_php' sh
## Additional commands
# Visualise repo, requires `gource`
.PHONY: gource
gource:
gource --log-format git \
--seconds-per-day 0.1 \
--title 'Elastica (https://github.com/ruflin/Elastica)' \
--user-scale 1 \
--max-user-speed 50