-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
18 lines (15 loc) · 744 Bytes
/
Copy pathMakefile
File metadata and controls
18 lines (15 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Makefile
IMAGE_TAG ?= 3.0.0
ECR_REGISTRY ?= 337689099048.dkr.ecr.ap-southeast-1.amazonaws.com
ECR_REPOSITORY ?= analytics
K8S_NAMESPACE ?= developeriq
.PHONY: deploy
deploy:
sed 's|{{IMAGE_TAG}}|$(IMAGE_TAG)|;s|{{ECR_REGISTRY}}|$(ECR_REGISTRY)|;s|{{ECR_REPOSITORY}}|$(ECR_REPOSITORY)|;s|{{K8S_NAMESPACE}}|$(K8S_NAMESPACE)|' deployment.yaml | kubectl apply -f -
.PHONY: delete
delete:
sed 's|{{IMAGE_TAG}}|$(IMAGE_TAG)|;s|{{ECR_REGISTRY}}|$(ECR_REGISTRY)|;s|{{ECR_REPOSITORY}}|$(ECR_REPOSITORY)|;s|{{K8S_NAMESPACE}}|$(K8S_NAMESPACE)|' deployment.yaml | kubectl delete -f -
.PHONY: build-and-push
build-and-push:
docker build -t $(ECR_REGISTRY)/$(ECR_REPOSITORY):$(IMAGE_TAG) .
docker push $(ECR_REGISTRY)/$(ECR_REPOSITORY):$(IMAGE_TAG)