-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
39 lines (30 loc) · 1.06 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
version ?= latest
CUR_DIR:=$(shell pwd)
BINARY_DIR:=$(CUR_DIR)/binaries
.PHONY: all
all: tools install format lint build ## (default) Runs 'tools deps format lint compile' targets
.PHONY: install
install:
dep ensure
.PHONY: tools
tools: ## Installs required go tools
go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
go get -u golang.org/x/tools/cmd/goimports
go get -u github.com/onsi/ginkgo/ginkgo
go get -u github.com/onsi/gomega
go get -u github.com/gobuffalo/packr/packr
.PHONY: format
format: ## Removes unneeded imports and formats source code
goimports -l -w ./core/ ./difference/ ./exporter/ ./log/ ./metrics/
.PHONY: lint
lint: install ## Concurrently runs a whole bunch of static analysis tools
golangci-lint run
.PHONY: test
test:
ginkgo -r
.PHONY: build
build: install test
packr build -o $(BINARY_DIR)/diferencia
.PHONY: crossbuild
crossbuild:
docker run -it --rm -v "$$PWD":/go/src/github.com/lordofthejars/diferencia -w /go/src/github.com/lordofthejars/diferencia -e "version=${version}" lordofthejars/diferenciarelease:0.3.0 crossbuild.sh