forked from trichner/berryhunter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (23 loc) · 738 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
TARGET=berryhunterd chieftaind berryhunter-web berryhunter-edge
TARGET_BUILD=$(addsuffix .build, $(TARGET))
TARGET_TAG=$(addsuffix .tag, $(TARGET))
TARGET_PUSH=$(addsuffix .push, $(TARGET))
TAG?="rev-$(shell git rev-parse HEAD | head -c 7)"
DOCKER_REPO="gcr.io/berryhunter-io"
all: build
build: $(TARGET_BUILD)
tag: $(TARGET_TAG)
push: $(TARGET_PUSH)
.PHONY: $(TARGET_BUILD)
$(TARGET_BUILD) : %.build:
@echo building $*
@docker build -t $* -f Dockerfile.$* .
.PHONY: $(TARGET_TAG)
$(TARGET_TAG) : %.tag:
@echo tagging $*
@docker tag $* $(DOCKER_REPO)/$*:$(TAG)
.PHONY: $(TARGET_PUSH)
$(TARGET_PUSH) : %.push: %.tag
@echo pushing $*
@docker push $(DOCKER_REPO)/$*:$(TAG)
.PHONY: berryhunterd chieftaind berryhunter-web all