-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (28 loc) · 916 Bytes
/
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
default_php_version:=7.4
default_server_port:=8080
php_version:=$(PHP_VERSION)
server_port:=$(PORT)
ifndef PHP_VERSION
php_version:=$(default_php_version)
endif
ifndef PORT
server_port:=$(default_server_port)
endif
base_dir:=$(shell basename $(CURDIR))
docker:=docker run --rm -v $(CURDIR):/app -w /app $(base_dir):$(php_version)
build:
docker build --build-arg VERSION=$(php_version) --tag $(base_dir):$(php_version) .
exec:
docker run --rm -ti -v $(CURDIR):/app:rw -w /app $(base_dir):$(php_version) sh
serve:
docker run -p$(server_port):8080 --rm -v $(CURDIR):/app -w /app $(base_dir):$(php_version) php -S 0.0.0.0:8080
install:
$(docker) composer install
install-no-dev:
$(docker) composer install --no-dev
static-analyze:
$(docker) composer static
unit:
$(docker) -dzend_extension=xdebug.so -dxdebug.mode=coverage vendor/bin/phpspec run
all: build install static-analyze unit
.PHONY: build