forked from oliviermadre/dic-it
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
31 lines (25 loc) · 1.25 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
.DEFAULT_GOAL: help
# See https://www.thapaliya.com/en/writings/well-documented-makefiles/
help: ## Display this help
@awk 'BEGIN {FS = ":.* ##"; printf "\n\033[1mUsage:\033[0m\n make \033[32m<target>\033[0m\n"} /^[a-zA-Z_-]+:.* ## / { printf " \033[33m%-25s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
COMPOSER_HOME ?= ${HOME}/.config/composer
COMPOSER_CACHE_DIR ?= ${HOME}/.cache/composer
COMPOSER = docker run -ti --rm \
--env COMPOSER_HOME=${COMPOSER_HOME} \
--env COMPOSER_CACHE_DIR=${COMPOSER_CACHE_DIR} \
--volume ${COMPOSER_HOME}:${COMPOSER_HOME} \
--volume ${COMPOSER_CACHE_DIR}:${COMPOSER_CACHE_DIR} \
--volume ${PWD}:/app \
--user $(shell id -u):$(shell id -g) \
--workdir /app \
composer:2 composer
DOCKER_RUN = docker run -t --rm --volume ${PWD}:/app --workdir /app evaneos/php:5.5.38-fpm-jessie-legacy-evaneos
##@ Development
lint: ## Lint the source code with PHP Codesniffer
${DOCKER_RUN} vendor/bin/phpcs --config-set show_warnings 0
${DOCKER_RUN} vendor/bin/phpcs --standard=./phpcs.xml src
test: ## Execute the tests with PHPUnit
${DOCKER_RUN} vendor/bin/phpunit --color
##@ Utils
composer: ## Execute a Composer command with make composer c="install"
${COMPOSER} ${c}