This repository was archived by the owner on Mar 23, 2021. It is now read-only.
forked from monzo/progression-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (46 loc) · 1.46 KB
/
Makefile
File metadata and controls
55 lines (46 loc) · 1.46 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
SHELL := /bin/bash
VERSION ?= 0.0.1
BUILD := $(shell date -u +%FT%T%z)
GIT_HASH := $(shell git rev-parse HEAD)
GIT_REPO := $(shell git config --get remote.origin.url)
BUILDKITE_COMMIT ?= $(GIT_HASH)
AWS_ACCOUNT ?= 896069866492
AWS_REGION ?= eu-west-1
APP_NAME := progression-framework
IMAGE_REPOSITORY := 896069866492.dkr.ecr.eu-west-1.amazonaws.com/progression-framework
ifneq (,$(wildcard env/${K8S_NAMESPACE}_app.yaml))
ENV_SPECIFIC_CONFIG := -f env/${K8S_NAMESPACE}_app.yaml
endif
export APP_NAME
export IMAGE_REPOSITORY
export BUILDKITE_COMMIT
.PHONY: build
build:
docker build -t ${IMAGE_REPOSITORY}:${BUILDKITE_COMMIT} .
.PHONY: publish
publish: build
docker push ${IMAGE_REPOSITORY}:${BUILDKITE_COMMIT}
.PHONY: kubeconfig
kubeconfig:
aws eks update-kubeconfig \
--region $(AWS_REGION) \
--name ${K8S_CLUSTER} \
--role-arn arn:aws:iam::$(AWS_ACCOUNT):role/${K8S_CLUSTER}-admin
.PHONY: deploy
deploy: kubeconfig
helm upgrade --install \
--kube-context=arn:aws:eks:$(AWS_REGION):$(AWS_ACCOUNT):cluster/${K8S_CLUSTER} \
--namespace=${K8S_NAMESPACE} \
-f app.yaml \
$(ENV_SPECIFIC_CONFIG) \
--set image.repository=${IMAGE_REPOSITORY},image.tag=${BUILDKITE_COMMIT} \
${APP_NAME}-${K8S_NAMESPACE} \
charts/reevooapp
.PHONY: tag-prod-image
tag-prod-image:
.buildkite/put_ecr_tag.sh ${APP_NAME} ${BUILDKITE_COMMIT}
.PHONY: image-scan
image-scan:
.buildkite/ecr_scan_findings.sh ${APP_NAME} ${BUILDKITE_COMMIT}
.PHONY: clean
clean: down