forked from v3io/app-resource-scaler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (45 loc) · 1.27 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
SCALER_TAG ?= unstable
SCALER_REPOSITORY ?= iguazio/
GOPATH ?= $(shell go env GOPATH)
OS_NAME = $(shell uname)
ensure-gopath:
ifndef GOPATH
$(error GOPATH must be set)
endif
.PHONY: build
build: dlx autoscaler
@echo Done.
.PHONY: dlx
dlx:
docker build -f dlx/Dockerfile --tag=$(SCALER_REPOSITORY)dlx:$(SCALER_TAG) .
.PHONY: autoscaler
autoscaler:
docker build -f autoscaler/Dockerfile --tag=$(SCALER_REPOSITORY)autoscaler:$(SCALER_TAG) .
.PHONY: modules
modules: ensure-gopath
@echo Getting go modules
@go mod download
.PHONY: fmt
fmt:
gofmt -s -w .
.PHONY: lint
lint: modules
@echo Installing linters...
@test -e $(GOPATH)/bin/impi || \
(mkdir -p $(GOPATH)/bin && \
curl -s https://api.github.com/repos/pavius/impi/releases/latest \
| grep -i "browser_download_url.*impi.*$(OS_NAME)" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -O $(GOPATH)/bin/impi -qi - \
&& chmod +x $(GOPATH)/bin/impi)
@test -e $(GOPATH)/bin/golangci-lint || \
(curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.33.0)
@echo Verifying imports...
$(GOPATH)/bin/impi \
--local github.com/v3io/app-resource-scaler/ \
--scheme stdLocalThirdParty \
./...
@echo Linting...
$(GOPATH)/bin/golangci-lint run -v
@echo Done.