-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (23 loc) · 879 Bytes
/
Copy pathMakefile
File metadata and controls
33 lines (23 loc) · 879 Bytes
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
ROOT := $(shell pwd)
APP_DIR = $(ROOT)
COMPOSER_IMG = composer/composer:php5-alpine
ARGS ?=
IS_DOCKER_AVAILABLE := $(shell command -v docker 2> /dev/null)
ifndef IS_DOCKER_AVAILABLE
$(error "This Makefile uses docker to build the app. Seems docker is not installed.")
endif
.PHONY: composer composer_update composer_require composer_remove all
# How to use ARGS
# make unit ARGS='--group integration'
build: composer
composer:
@docker run --rm -v $(APP_DIR):/app $(COMPOSER_IMG) install --no-interaction
composer_update:
@docker run --rm -v $(APP_DIR):/app $(COMPOSER_IMG) update $(ARGS)
composer_require:
@docker run --rm -v $(APP_DIR):/app $(COMPOSER_IMG) require $(ARGS)
composer_remove:
@docker run --rm -v $(APP_DIR):/app $(COMPOSER_IMG) remove $(ARGS)
unit:
@docker run -it --rm -v $(APP_DIR):/usr/src/lib -w /usr/src/lib php:5.6-cli bin/phpunit
tests: unit