-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (32 loc) · 860 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
34
35
36
37
38
39
40
41
42
43
export AWS_PROFILE := $(AWS_PROFILE)
export AWS_DEFAULT_REGION := $(shell aws configure get region --profile $(AWS_PROFILE))
YAML := config.yaml
LAMBDA := "lambda.go"
INTERVAL ?= "rate(15 minutes)"
TF_ARGS := -var=interval=$(INTERVAL)
build:
GOOS=linux go build $(LAMBDA)
GOOS=linux go build -o $$GOPATH/bin/checker main.go
zip terraform/checker.zip lambda $(YAML)
rm -f lambda
tf_apply: tf_plan
cd terraform && terraform_13 apply $(TF_ARGS) -auto-approve
tf_destroy:
cd terraform && terraform_13 destroy $(TF_ARGS)
tf_plan:
cd terraform && terraform_13 plan $(TF_ARGS)
tf_clean:
rm -f terraform/checker.zip
destroy: tf_destroy tf_clean encrypt
apply: build tf_apply tf_clean encrypt
plan: build tf_plan
encrypt:
git secret hide -m
decrypt:
git secret reveal -f
push: encrypt
git add .
git commit
git push
prepare:
git secret remove -c