-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
73 lines (48 loc) · 1.45 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
ifneq (,$(wildcard ./.env))
include .env
export
else
$(error You haven't setup your .env file. Please refer to the readme)
endif
LAMBDA_GOOS=linux
LAMBDA_GOARCH=arm64
LAMBDA_GOCC?=go
LAMBDA_GOFLAGS=-tags=lambda.norpc
LAMBDA_CGO_ENABLED=0
LAMBDAS=build/getclaim/bootstrap build/getclaims/bootstrap build/getroot/bootstrap build/notifier/bootstrap build/postclaims/bootstrap build/providercache/bootstrap build/remotesync/bootstrap
ucangen:
go build -o ./ucangen cmd/ucangen/main.go
.PHONY: ucankey
ucankey: ucangen
./ucangen
.PHONY: clean-lambda
clean-lambda:
rm -rf build
.PHONY: clean-terraform
clean-terraform:
tofu -chdir=deploy/app destroy
.PHONY: clean
clean: clean-terraform clean-lambda
lambdas: $(LAMBDAS)
.PHONY: $(LAMBDAS)
$(LAMBDAS): build/%/bootstrap:
GOOS=$(LAMBDA_GOOS) GOARCH=$(LAMBDA_GOARCH) CGO_ENABLED=$(LAMBDA_CGO_ENABLED) $(LAMBDA_GOCC) build $(LAMBDA_GOFLAGS) -o $@ cmd/lambda/$*/main.go
deploy/app/.terraform:
tofu -chdir=deploy/app init
.tfworkspace:
tofu -chdir=deploy/app workspace new $(TF_WORKSPACE)
touch .tfworkspace
.PHONY: init
init: deploy/app/.terraform .tfworkspace
.PHONY: validate
validate: deploy/app/.terraform .tfworkspace
tofu -chdir=deploy/app validate
.PHONY: plan
plan: deploy/app/.terraform .tfworkspace $(LAMBDAS)
tofu -chdir=deploy/app plan
.PHONY: apply
apply: deploy/app/.terraform .tfworkspace $(LAMBDAS)
tofu -chdir=deploy/app apply
deploy/app/.terraform:
tofu -chdir=deploy/app init
shared: