-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
33 lines (26 loc) · 944 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
# Parameters to compile and run application
GOOS?=linux
GOARCH?=amd64
PROJECT?=github.com/rumyantseva/go-workshop
BUILD_PATH?=cmd/go-workshop
APP?=go-workshop
PORT?=8000
DIAG_PORT?=3001
# Current version and commit
RELEASE?=0.0.1
COMMIT?=$(shell git rev-parse --short HEAD)
BUILD_TIME?=$(shell date -u '+%Y-%m-%d_%H:%M:%S')
# Parameters to push images and release app to Kubernetes or try it with Docker
REGISTRY?=docker.io/webdeva
NAMESPACE?=rumyantseva
CONTAINER_NAME?=${NAMESPACE}-${APP}
CONTAINER_IMAGE?=${REGISTRY}/${CONTAINER_NAME}
VALUES?=values-stable
build:
docker build -t $(CONTAINER_IMAGE):$(RELEASE) .
push: build
docker push $(CONTAINER_IMAGE):$(RELEASE)
deploy: push
helm upgrade ${CONTAINER_NAME} -f charts/${VALUES}.yaml charts \
--kube-context ${KUBE_CONTEXT} --namespace ${NAMESPACE} --version=${RELEASE} -i --wait \
--set image.registry=${REGISTRY} --set image.name=${CONTAINER_NAME} --set image.tag=${RELEASE}