forked from emcniece/docker-pb-ip-monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (45 loc) · 1.27 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
# Creates a base image for EspressoAddicted/pb-ip-monitor
NAMESPACE := EspressoAddicted
PROJECT := pb-ip-monitor
PLATFORM := linux
ARCH := amd64
DOCKER_IMAGE := $(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-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 PB_TOKEN="${PB_TOKEN}" \
$(DOCKER_IMAGE):$(VERSION)
run-debug:
docker run -d \
-e PB_TOKEN="${PB_TOKEN}" \
$(DOCKER_IMAGE):$(VERSION) \
tail -f /dev/null
test-cron:
docker run -d \
-e PB_TOKEN="${PB_TOKEN}" \
$(DOCKER_IMAGE):$(VERSION) \
run-parts --test /etc/periodic/15min
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
clean:
docker rmi $(DOCKER_IMAGE):$(VERSION)
docker rmi $(DOCKER_IMAGE):latest