forked from hashicorp/vault-lambda-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (45 loc) · 1.22 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
GOOS?=linux
GOARCH?=amd64
CI_TEST_ARGS=
.PHONY: build lint test clean mod quick-start quick-start-destroy publish-layer-version
build: clean
GOOS=$(GOOS) GOARCH=$(GOARCH) CGO_ENABLED=0 go build \
-ldflags '-s -w' \
-a -o pkg/extensions/vault-lambda-extension \
.
lint:
golangci-lint run -v --concurrency 2 \
--disable-all \
--timeout 10m \
--enable gofmt \
--enable gosimple \
--enable govet
test:
gotestsum --format=short-verbose $(CI_TEST_ARGS)
clean:
-rm -rf pkg
mod:
@go mod tidy
quick-start:
bash quick-start/build.sh
cd quick-start/terraform && \
terraform init && \
terraform apply -auto-approve
aws lambda invoke --function-name vault-lambda-extension-demo-function /dev/null \
--cli-binary-format raw-in-base64-out \
--log-type Tail \
--region us-east-1 \
| jq -r '.LogResult' \
| base64 --decode
quick-start-destroy:
cd quick-start/terraform && \
terraform destroy -auto-approve
publish-layer-version: build
cd pkg && zip -r vault-lambda-extension.zip extensions/
aws lambda publish-layer-version \
--layer-name "vault-lambda-extension" \
--zip-file "fileb://pkg/vault-lambda-extension.zip" \
--region "us-east-1" \
--no-cli-pager \
--output text \
--query LayerVersionArn