-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
54 lines (44 loc) · 1.1 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
PROJECT := signy
ORG := cnabio
BINDIR := $(CURDIR)/bin
GOFLAGS :=
GOBUILDTAGS := osusergo
LDFLAGS := -w -s
ifeq ($(OS),Windows_NT)
TARGET = $(PROJECT).exe
SHELL = cmd.exe
CHECK = where.exe
else
TARGET = $(PROJECT)
SHELL ?= bash
CHECK ?= which
endif
.PHONY: build
build:
go build $(GOFLAGS) -tags '$(GOBUILDTAGS)' -ldflags '$(LDFLAGS)' -o $(BINDIR)/$(TARGET) github.com/$(ORG)/$(PROJECT)/cmd/...
.PHONY: install
install: build
mv $(BINDIR)/$(TARGET) $(GOPATH)/bin
.PHONY: test
test:
go test $(TESTFLAGS) ./...
.PHONY: lint
lint:
golangci-lint run --config ./golangci.yml
HAS_GOLANGCI := $(shell $(CHECK) golangci-lint)
HAS_GOIMPORTS := $(shell $(CHECK) goimports)
GOLANGCI_VERSION := v1.16.0
.PHONY: bootstrap
bootstrap:
ifndef HAS_GOLANGCI
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOPATH)/bin $(GOLANGCI_VERSION)
endif
ifndef HAS_GOIMPORTS
go get -u golang.org/x/tools/cmd/goimports
endif
.PHONY: e2e
e2e:
make e2e-list
.PHONY: e2e-list
e2e-list:
./bin/signy list docker.io/library/alpine