forked from acorn-io/acorn-istio-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (24 loc) · 746 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
build:
CGO_ENABLED=0 go build -o bin/istio-plugin -ldflags "-s -w" .
tidy:
go mod tidy
lint: setup-env
golangci-lint --timeout 5m run
test:
go test ./...
validate: tidy lint
if [ -n "$$(git status --porcelain)" ]; then \
git status --porcelain; \
echo "Encountered dirty repo!"; \
exit 1 \
;fi
GOLANGCI_LINT_VERSION ?= v1.51.1
setup-env:
if ! command -v golangci-lint &> /dev/null; then \
echo "Could not find golangci-lint, installing version $(GOLANGCI_LINT_VERSION)."; \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin $(GOLANGCI_LINT_VERSION); \
fi
image:
docker build .
goreleaser:
goreleaser build --snapshot --single-target --rm-dist