-
Notifications
You must be signed in to change notification settings - Fork 25
/
Makefile
56 lines (39 loc) · 1.64 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
NAME=kubectl-doctor
PACKAGE_NAME=github.com/emirozer/$(NAME)
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
bin:
mkdir bin
dep:
glide up -v
build: bin
go build -o kubectl-doctor cmd/kubectl-doctor.go
cp ./kubectl-doctor /usr/local/bin/plugins
mv ./kubectl-doctor ./bin
lint: $(GOPATH)/bin/golint$(suffix)
golint
vet:
go vet
test: vet
go test -race -v -cover ./...
clean:
rm -fr dist bin
rm /usr/local/bin/plugins/kubectl-doctor
fmt:
gofmt -w $(GOFMT_FILES)
release:
mkdir dist
env GOOS=linux GOARCH=amd64 go build -o kubectl-doctor cmd/kubectl-doctor.go ; mv kubectl-doctor dist/kubectl-doctor_linux_amd64
env GOOS=linux GOARCH=arm go build -o kubectl-doctor cmd/kubectl-doctor.go ; mv kubectl-doctor dist/kubectl-doctor_linux_arm
env GOOS=darwin GOARCH=amd64 go build -o kubectl-doctor cmd/kubectl-doctor.go ; mv kubectl-doctor dist/kubectl-doctor_darwin_amd64
env GOOS=darwin GOARCH=arm64 go build -o kubectl-doctor cmd/kubectl-doctor.go ; mv kubectl-doctor dist/kubectl-doctor_darwin_arm64
env GOOS=windows GOARCH=amd64 go build -o kubectl-doctor cmd/kubectl-doctor.go ; mv kubectl-doctor dist/kubectl-doctor_windows_amd64.exe
env GOOS=freebsd GOARCH=amd64 go build -o kubectl-doctor cmd/kubectl-doctor.go ; mv kubectl-doctor dist/kubectl-doctor_freebsd_amd64
dist/$(NAME)-checksum-%:
cd dist && sha256sum $@.zip
checksums: dist/$(NAME)-checksum-darwin-amd64 dist/$(NAME)-checksum-windows-386 dist/$(NAME)-checksum-windows-amd64 dist/$(NAME)-checksum-linux-amd64
.PHONY: fmt clean lint build