-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
71 lines (59 loc) · 1.51 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
BINARY=postman
VERSION=0.3
BUILD=`git rev-parse HEAD | head -c 8`
LDFLAGS="-X main.Version=${VERSION} -X main.Build=${BUILD}"
.PHONY: build
build: generate
@echo "==> Building"
@go generate dashboard/*.go
@go build -ldflags ${LDFLAGS} -o build/${BINARY} cmd/*.go
@echo "\n==>\033[32m Ok\033[m\n"
.PHONY: generate
generate:
@echo "==> Generating"
@go generate dashboard/*.go
@echo "\n==>\033[32m Ok\033[m\n"
.PHONY: release
release:
@echo "==> Releasing for all platforms"
@python scripts/release.py -ldflags \"${LDFLAGS}\" cmd/*.go
@echo "\n==>\033[32m Ok\033[m\n"
.PHONY: install
install:
@echo "==> Installing in ${GOPATH}/bin/${BINARY}"
@cp build/${BINARY} ${GOPATH}/bin/
@echo "\n==>\033[32m Ok\033[m\n"
.PHONY: test
test:
@echo "==> Running all tests"
@go test ./...
.PHONY: lint
lint:
@echo "==> Running static analysis tests"
@golint -set_exit_status -min_confidence 0.9 cmd/...
@golint -set_exit_status -min_confidence 0.9 async/...
@golint -set_exit_status -min_confidence 0.9 proxy/...
.PHONY: test.setup
test.setup:
@echo "==> Install dep"
@go get github.com/golang/dep/cmd/dep
@echo "==> Install golint"
@go get github.com/golang/lint
@echo "==> Install go-bin"
@go get -u github.com/jteeuwen/go-bindata/...
@echo "==> Install dependencies"
@dep ensure
# Show to-do items per file.
todo:
@grep \
--exclude-dir=vendor \
--exclude-dir=node_modules \
--text \
--color \
-nRo -E ' TODO:.*|SkipNow' .
.PHONY:clean
clean:
@rm -rf build/*
.PHONY:docker
docker:
@docker build -t postman .