forked from Versent/saml2aws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (51 loc) · 1.59 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
NAME=saml2aws
ARCH=$(shell uname -m)
VERSION=2.28.0
ITERATION := 1
GOLANGCI_VERSION = 1.32.0
GORELEASER_VERSION = 0.157.0
SOURCE_FILES?=$$(go list ./... | grep -v /vendor/)
TEST_PATTERN?=.
TEST_OPTIONS?=
BIN_DIR := $(CURDIR)/bin
ci: prepare test
$(BIN_DIR)/golangci-lint: $(BIN_DIR)/golangci-lint-${GOLANGCI_VERSION}
@ln -sf golangci-lint-${GOLANGCI_VERSION} $(BIN_DIR)/golangci-lint
$(BIN_DIR)/golangci-lint-${GOLANGCI_VERSION}:
@curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | BINARY=golangci-lint bash -s -- v${GOLANGCI_VERSION}
@mv $(BIN_DIR)/golangci-lint $@
$(BIN_DIR)/goreleaser: $(BIN_DIR)/goreleaser-${GORELEASER_VERSION}
@ln -sf goreleaser-${GORELEASER_VERSION} $(BIN_DIR)/goreleaser
$(BIN_DIR)/goreleaser-${GORELEASER_VERSION}:
@curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINARY=goreleaser bash -s -- v${GORELEASER_VERSION}
@mv $(BIN_DIR)/goreleaser $@
mod:
@go mod download
@go mod tidy
.PHONY: mod
lint: $(BIN_DIR)/golangci-lint
@echo "--- lint all the things"
@$(BIN_DIR)/golangci-lint run ./...
.PHONY: lint
lint-fix: $(BIN_DIR)/golangci-lint
@echo "--- lint all the things"
@$(BIN_DIR)/golangci-lint run --fix ./...
.PHONY: lint-fix
fmt: lint-fix
install:
go install ./cmd/saml2aws
.PHONY: mod
build: $(BIN_DIR)/goreleaser
$(BIN_DIR)/goreleaser build --snapshot --rm-dist
.PHONY: build
clean:
@rm -fr ./build
.PHONY: clean
generate-mocks:
mockery -dir pkg/prompter --all
mockery -dir pkg/provider/okta -name U2FDevice
.PHONY: generate-mocks
test:
@echo "--- test all the things"
@go test -cover ./...
.PHONY: test