-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
44 lines (32 loc) · 1007 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
44
GOARCH = amd64
TEST?=$$(go list ./... | grep -v /vendor/)
UNAME = $(shell uname -s)
ifndef OS
ifeq ($(UNAME), Linux)
OS = linux
else ifeq ($(UNAME), Darwin)
OS = darwin
endif
endif
.DEFAULT_GOAL := all
all: fmt build start
build:
GOOS=$(OS) GOARCH="$(GOARCH)" CGO_ENABLED=0 go build -o vault/plugins/vault-plugin-secrets-cognito-${OS}-${GOARCH} cmd/vault-plugin-secrets-cognito/main.go
start:
vault server -dev -dev-root-token-id=root -dev-plugin-dir=./vault/plugins -log-level=trace
enable:
vault secrets enable -path=cognito vault-plugin-secrets-cognito-${OS}-${GOARCH}
clean:
rm -f ./vault/plugins/vault-plugin-secrets-cognito-${OS}-${GOARCH}
fmt:
go fmt $$(go list ./...)
# test runs all tests
test: generate
@if [ "$(TEST)" = "./..." ]; then \
echo "ERROR: Set TEST to a specific package"; \
exit 1; \
fi
VAULT_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 45m
generate:
go generate $(go list ./... | grep -v /vendor/)
.PHONY: build clean fmt start enable test generate