-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (45 loc) · 1.41 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
# make build UNIT=9 PHP_VER=7.4
-include phpunit.mk
PHP_VER := 7.4
XDEBUG_VER := 3.2.1
PHPUNIT_MINOR_VER := $(shell echo "${PHPUNIT_VER}" | grep -oE '^[0-9]+\.[0-9]+')
PHPUNIT_MAJOR_VER := $(shell echo "${PHPUNIT_VER}" | grep -oE '^[0-9]+')
TAG := php$(PHP_VER)-phpunit$(PHPUNIT_MINOR_VER)
TAG_MAJOR := php$(PHP_VER)-phpunit$(PHPUNIT_MAJOR_VER)
REPO = walkero/phpunit-alpine
NAME = $(TAG)
.PHONY: build buildnc buildmajor push shell start stop logs clean release
default: build
build:
$(info Building phpunit image with tag $(TAG))
docker build -t $(REPO):$(TAG) \
--progress plain \
--build-arg PHP_VER=$(PHP_VER) \
--build-arg PHPUNIT_VER=$(PHPUNIT_VER) \
--build-arg XDEBUG_VER=$(XDEBUG_VER) ./
buildnc:
docker build --no-cache -t $(REPO):$(TAG) \
--progress plain \
--build-arg PHP_VER=$(PHP_VER) \
--build-arg PHPUNIT_VER=$(PHPUNIT_VER) \
--build-arg XDEBUG_VER=$(XDEBUG_VER) ./
buildmajor:
docker build --no-cache -t $(REPO):$(TAG_MAJOR) \
--progress plain \
--build-arg PHP_VER=$(PHP_VER) \
--build-arg PHPUNIT_VER=$(PHPUNIT_VER) \
--build-arg XDEBUG_VER=$(XDEBUG_VER) ./
push:
docker push $(REPO):$(TAG)
docker push $(REPO):$(TAG_MAJOR)
shell:
docker run --rm --name $(NAME) -it $(REPO):$(TAG) /bin/bash
start:
docker run -d --name $(NAME) $(REPO):$(TAG)
stop:
docker stop $(NAME)
logs:
docker logs $(NAME)
clean:
-docker rm -f $(NAME)
release: buildnc buildmajor push