-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (31 loc) · 800 Bytes
/
Makefile
File metadata and controls
41 lines (31 loc) · 800 Bytes
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
.PHONY:
REPO = monarchstore
IMAGE = monarchs
TAG := $(shell git log -1 --pretty=format:"%h")
DOCKER_IMAGE=$(REPO)/$(IMAGE):$(TAG)
LATEST_IMAGE=$(REPO)/$(IMAGE):latest
DOCKERFILE_DIR=.
CHART_DIR=chart/monarchs
RELEASE_NAME ?= monarchs
RELEASE_NAMESPACE ?= monarchs
DOCKER_TAG ?= latest
.PHONY: build
build:
go build .
.PHONY: container
container:
docker build -t $(DOCKER_IMAGE) $(DOCKERFILE_DIR) --build-arg commit=$(TAG)
docker tag $(DOCKER_IMAGE) $(LATEST_IMAGE)
.PHONY: push-container
push-container: container
docker push $(DOCKER_IMAGE)
docker push $(LATEST_IMAGE)
.PHONY: chart
chart:
helm lint $(CHART_DIR)
.PHONY: install-chart
install-chart:
helm upgrade --install $(RELEASE_NAME) \
--namespace $(RELEASE_NAMESPACE) \
--set image.tag=$(DOCKER_TAG) \
$(CHART_DIR)