forked from allegro/mesos-executor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (34 loc) · 1.32 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
APPLICATION_NAME := github.com/allegro/mesos-executor
APPLICATION_VERSION := $(shell git describe --tags || echo "unknown")
LDFLAGS := -X main.Version=$(APPLICATION_VERSION)
BUILD_FOLDER := target
GO_BUILD := go build -v -ldflags "$(LDFLAGS)" -a
CURRENT_DIR = $(shell pwd)
PATH := $(CURRENT_DIR)/bin:$(PATH)
.PHONY: clean test all build package deps lint lint-deps \
generate-source generate-source-deps
all: lint test build
build: $(BUILD_FOLDER)
$(GO_BUILD) -o $(BUILD_FOLDER)/executor ./cmd/executor
$(BUILD_FOLDER):
mkdir $(BUILD_FOLDER)
clean:
go clean -v .
rm -rf $(BUILD_FOLDER)
rm -rf $(CURRENT_DIR)/bin
generate-source: generate-source-deps
go generate -v $$(go list ./... | grep -v /vendor/)
generate-source-deps:
go get -v -u golang.org/x/tools/cmd/stringer
lint: lint-deps
gometalinter.v2 --config=gometalinter.json ./...
lint-deps:
@which gometalinter.v2 > /dev/null || \
(go get -u -v gopkg.in/alecthomas/gometalinter.v2 && gometalinter.v2 --install)
package: $(BUILD_FOLDER)/executor
zip -j $(BUILD_FOLDER)/executor-$(APPLICATION_VERSION)-linux-amd64.zip $(BUILD_FOLDER)/executor
chmod 0755 $(BUILD_FOLDER)/executor-$(APPLICATION_VERSION)-linux-amd64.zip
test: test-deps
go test -coverprofile=$(BUILD_FOLDER)/coverage.txt -covermode=atomic ./...
test-deps: $(BUILD_FOLDER)
./scripts/install-consul.sh