-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
90 lines (59 loc) · 1.66 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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
indexer:
go build -o ./indexer ./cmd
.PHONY: clean-indexer
clean-indexer:
rm -f ./indexer
.PHONY: test
test:
go test -race -v ./...
.PHONY: test-nocache
test-nocache:
go clean -testcache && make test
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 clean-indexer
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
.PHONY: mockery
mockery:
mockery --config=.mockery.yaml