-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
52 lines (37 loc) · 1.04 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
NODE_VER ?= 8.11
DRUPAL_NODE_VER ?= 1.0.10
DRUPAL_NODE_VER_MINOR ?= $(shell echo "${DRUPAL_NODE_VER}" | grep -oE '^[0-9]+\.[0-9]+')
REPO = wodby/drupal-node
NAME = drupal-node-$(DRUPAL_NODE_VER_MINOR)
TAG ?= $(DRUPAL_NODE_VER_MINOR)
BASE_IMAGE_TAG = $(NODE_VER)-0.2.0
ifneq ($(STABILITY_TAG),)
ifneq ($(TAG),latest)
override TAG := $(TAG)-$(STABILITY_TAG)
endif
endif
.PHONY: build test push shell run start stop logs clean release
default: build
build:
docker build -t $(REPO):$(TAG) \
--build-arg BASE_IMAGE_TAG=$(BASE_IMAGE_TAG) \
--build-arg DRUPAL_NODE_VER=$(DRUPAL_NODE_VER) \
./
test:
cd tests/7 && IMAGE=$(REPO):$(TAG) ./run.sh
cd tests/8 && IMAGE=$(REPO):$(TAG) ./run.sh
push:
docker push $(REPO):$(TAG)
shell:
docker run --rm --name $(NAME) $(PARAMS) -ti $(REPO):$(TAG) /bin/bash
run:
docker run --rm --name $(NAME) $(PARAMS) $(REPO):$(TAG) $(CMD)
start:
docker run -d --name $(NAME) $(PARAMS) $(REPO):$(TAG)
stop:
docker stop $(NAME)
logs:
docker logs $(NAME)
clean:
-docker rm -f $(NAME)
release: build push