-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (33 loc) · 1.11 KB
/
Makefile
File metadata and controls
43 lines (33 loc) · 1.11 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
PATH:= $(PATH):$(GOBIN)
export PATH
SHELL:= env PATH=$(PATH) /bin/bash
AWS_ACCOUNT ?= $(shell aws sts get-caller-identity --query "Account" --output text)
.PHONY: tf-apply
tf-apply: tf-init
cd terraform/ && terraform apply -auto-approve
.PHONY: tf-clean
tf-clean:
find . -type d -a -name .terraform -print0 | xargs -0 rm -rf
find . -type f -a -name "terraform.tfstate*" -print0 | xargs -0 rm -rf
find . -type f -a -name ".terraform.lock.hcl" -print0 | xargs -0 rm -rf
.PHONY: tf-destroy
tf-destroy: tf-init .k8s-destroy
cd terraform/ && terraform destroy -auto-approve
.PHONY: tf-fmt
tf-fmt:
cd terraform/ && terraform fmt -recursive
.PHONY: tf-init
tf-init: .pre-validate
cd terraform/ && terraform init
.PHONY: tf-plan
tf-plan: tf-init
cd terraform/ && terraform plan
.PHONY: k8s-config
k8s-config: .pre-validate
aws eks update-kubeconfig --name apps --region eu-west-1 --role-arn arn:aws:iam::$(AWS_ACCOUNT):role/kubernetes-cluster-admin
.PHONY: .k8s-destroy
.k8s-destroy: k8s-config
kubectl delete ingress platform-code-test-app -n default
.PHONY: .pre-validate
.pre-validate:
@bin/check_account "$(AWS_ACCOUNT)"