forked from instrumenta/kubeval
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
82 lines (57 loc) · 1.84 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
NAME=kubeval
IMAGE_NAME=garethr/$(NAME)
PACKAGE_NAME=github.com/instrumenta/$(NAME)
GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor)
TAG=$(shell git describe --abbrev=0 --tags)
all: build
$(GOPATH)/bin/golint$(suffix):
go get github.com/golang/lint/golint
$(GOPATH)/bin/goveralls$(suffix):
go get github.com/mattn/goveralls
vendor:
go mod vendor
.bats:
git clone --depth 1 https://github.com/sstephenson/bats.git .bats
bin:
mkdir bin
release:
goreleaser --rm-dist
snapshot:
goreleaser --snapshot --skip-publish --rm-dist
build: bin
go build -o bin/$(NAME) .
lint: $(GOPATH)/bin/golint$(suffix)
golint
docker:
docker build -t $(IMAGE_NAME):$(TAG) .
docker tag $(IMAGE_NAME):$(TAG) $(IMAGE_NAME):latest
docker push $(IMAGE_NAME):$(TAG)
docker push $(IMAGE_NAME):latest
docker-offline:
docker build -f Dockerfile.offline -t $(IMAGE_NAME):$(TAG)-offline .
docker tag $(IMAGE_NAME):$(TAG)-offline $(IMAGE_NAME):offline
vet:
go vet
test: vet
go test -race -v -cover ./...
watch:
ls */*.go | entr make test
acceptance:
docker build -f Dockerfile.acceptance -t $(IMAGE_NAME):$(TAG)-acceptance .
docker tag $(IMAGE_NAME):$(TAG)-acceptance $(IMAGE_NAME):acceptance
cover:
go test -v ./$(NAME) -coverprofile=coverage.out
go tool cover -html=coverage.out
rm coverage.out
clean:
rm -fr dist bin
fmt:
gofmt -w $(GOFMT_FILES)
dist/$(NAME)-checksum-%:
cd dist && sha256sum [email protected]
checksums: dist/$(NAME)-checksum-darwin-amd64 dist/$(NAME)-checksum-windows-386 dist/$(NAME)-checksum-windows-amd64 dist/$(NAME)-checksum-linux-amd64
chocolatey/$(NAME)/$(NAME).$(TAG).nupkg: chocolatey/$(NAME)/$(NAME).nuspec
cd chocolatey/$(NAME) && choco pack
choco:
cd chocolatey/$(NAME) && choco push $(NAME).$(TAG).nupkg -s https://chocolatey.org/
.PHONY: release snapshot fmt clean cover acceptance lint docker test vet watch build check choco checksums