-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
65 lines (54 loc) · 1.52 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
62
63
64
65
# Creates a base image for emcniece/docker-boarding
NAMESPACE := emcniece
PROJECT := docker-boarding
PLATFORM := linux
ARCH := amd64
DOCKER_IMAGE := $(NAMESPACE)/$(PROJECT)
RUN_NAME := $(NAMESPACE)-$(PROJECT)
VERSION := $(shell cat VERSION)
GITSHA := $(shell git rev-parse --short HEAD)
all: help
help:
@echo "---"
@echo "IMAGE: $(DOCKER_IMAGE)"
@echo "VERSION: $(VERSION)"
@echo "---"
@echo "make image - compile Docker image"
@echo "make run - run container normally"
@echo "make run-debug - run container with tail"
@echo "make docker - push to Docker repository"
@echo "make release - push to latest tag Docker repository"
image:
docker build -t $(DOCKER_IMAGE):$(VERSION) \
-f Dockerfile .
run:
docker run -d \
-e ITC_USER=${ITC_USER} \
-e ITC_PASSWORD=${ITC_PASSWORD} \
-e ITC_APP_ID=${ITC_APP_ID} \
-e ITC_APP_TESTER_GROUPS="${ITC_APP_TESTER_GROUPS}" \
-p 3000:3000 \
--name $(RUN_NAME) \
$(DOCKER_IMAGE):$(VERSION)
run-debug:
docker run -d --rm \
-e ITC_USER=${ITC_USER} \
-e ITC_PASSWORD=${ITC_PASSWORD} \
-e ITC_APP_ID=${ITC_APP_ID} \
-p 3000:3000 \
--name $(RUN_NAME)
$(DOCKER_IMAGE):$(VERSION) \
tail -f /dev/null
docker:
@echo "Pushing $(DOCKER_IMAGE):$(VERSION)"
docker push $(DOCKER_IMAGE):$(VERSION)
release: docker
@echo "Pushing $(DOCKER_IMAGE):latest"
docker tag $(DOCKER_IMAGE):$(VERSION) $(DOCKER_IMAGE):latest
docker push $(DOCKER_IMAGE):latest
kill:
docker kill $(RUN_NAME)
docker rm $(RUN_NAME)
clean:
docker rmi $(DOCKER_IMAGE):$(VERSION)
docker rmi $(DOCKER_IMAGE):latest