forked from v3io/flex-fuse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
87 lines (74 loc) · 1.92 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
83
84
85
86
87
SRC_BINARY_NAME ?= "igz-fuse"
DST_BINARY_NAME ?= "igz-fuse"
FETCH_METHOD ?= "download"
MIRROR ?=
IGUAZIO_VERSION ?=
RPM_PATH = "iguazio_yum"
DEB_PATH = "iguazio_deb"
.PHONY: build
build:
docker build --tag flex-fuse:unstable .
.PHONY: download
download:
rm -rf hack/libs/${DST_BINARY_NAME}*
wget --quiet $(MIRROR)/$(RPM_PATH)/$(IGUAZIO_VERSION)/$(SRC_BINARY_NAME).rpm -O hack/libs/$(DST_BINARY_NAME).rpm
#wget --quiet $(MIRROR)/$(DEB_PATH)/$(IGUAZIO_VERSION)/$(SRC_BINARY_NAME).deb -O hack/libs/$(DST_BINARY_NAME).deb
touch hack/libs/$(IGUAZIO_VERSION)
.PHONY: copy
copy:
rm -rf hack/libs/${DST_BINARY_NAME}*
cp $(MIRROR)/$(SRC_BINARY_NAME).rpm hack/libs/$(DST_BINARY_NAME).rpm
#cp $(MIRROR)/$(SRC_BINARY_NAME).deb hack/libs/$(DST_BINARY_NAME).deb
touch hack/libs/$(IGUAZIO_VERSION)
.PHONY: release
release: check-req $(FETCH_METHOD) build
docker tag flex-fuse:unstable iguazio/flex-fuse:$(IGUAZIO_VERSION)
.PHONY: lint
lint: ensure-gopath
@echo Installing linters...
go get -u gopkg.in/alecthomas/gometalinter.v2
@$(GOPATH)/bin/gometalinter.v2 --install
@echo Linting...
@$(GOPATH)/bin/gometalinter.v2 \
--deadline=300s \
--disable-all \
--enable-gc \
--enable=deadcode \
--enable=goconst \
--enable=gofmt \
--enable=golint \
--enable=gosimple \
--enable=ineffassign \
--enable=interfacer \
--enable=misspell \
--enable=staticcheck \
--enable=unconvert \
--enable=varcheck \
--enable=vet \
--enable=vetshadow \
--enable=errcheck \
--exclude="_test.go" \
--exclude="comment on" \
--exclude="error should be the last" \
--exclude="should have comment" \
./cmd/... ./pkg/...
@echo Done.
.PHONY: vet
vet:
go vet ./cmd/...
go vet ./pkg/...
.PHONY: test
test:
go test -v ./cmd/...
go test -v ./pkg/...
check-req:
ifndef MIRROR
$(error MIRROR must be set)
endif
ifndef IGUAZIO_VERSION
$(error IGUAZIO_VERSION must be set)
endif
ensure-gopath:
ifndef GOPATH
$(error GOPATH must be set)
endif