-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
43 lines (29 loc) · 906 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
34
35
36
37
38
39
40
41
42
43
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
.PHONY: build.frontend build.backend
build: build.frontend build.backend
build.backend: build.frontend
build.backend:
$(MAKE) -C backend build
build.frontend:
$(MAKE) -C frontend 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