-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (31 loc) · 1.05 KB
/
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
34
35
36
37
38
39
40
TF_ROOT := ./infra/envs/dev
CURRENT_REF := $(shell git symbolic-ref HEAD)
.PHONY: plan
plan:
cd $(TF_ROOT) && terraform plan -var="gitops_ref_name=$(CURRENT_REF)"
.PHONY: init
init:
cd $(TF_ROOT) && terraform init
.PHONY: apply
apply:
cd $(TF_ROOT) && terraform apply -auto-approve -var="gitops_ref_name=$(CURRENT_REF)"
.PHONY: destroy
destroy: gitops-destroy
cd $(TF_ROOT) && terraform state rm 'module.k8s_cluster.module.flux[0]' || true
cd $(TF_ROOT) && terraform destroy -auto-approve
.PHONY: gitops-redeploy
gitops-redeploy: gitops-destroy
cd $(TF_ROOT) && terraform apply -auto-approve \
-target "module.k8s_cluster.module.flux[0].helm_release.flux_sync" \
-var="gitops_ref_name=$(CURRENT_REF)"
.PHONY: gitops-destroy
gitops-destroy:
cd $(TF_ROOT) && terraform destroy -auto-approve \
-target "module.k8s_cluster.module.flux[0].helm_release.flux_sync"
sleep 60
.PHONY: docs
docs: venv
source venv/bin/activate && mkdocs serve --config-file docs/mkdocs.yml
venv:
python -m venv venv
source venv/bin/activate && pip install mkdocs mkdocs-material