forked from influxdata/chronograf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (50 loc) · 1.3 KB
/
Makefile
File metadata and controls
75 lines (50 loc) · 1.3 KB
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
VERSION ?= $(shell git describe --always --tags)
COMMIT ?= $(shell git rev-parse --short=8 HEAD)
SOURCES := $(shell find . -name '*.go')
LDFLAGS=-ldflags "-s -X main.Version=${VERSION} -X main.Commit=${COMMIT}"
BINARY=chronograf
default: dep build
build: assets ${BINARY}
dev: dev-assets ${BINARY}
${BINARY}: $(SOURCES)
go build -o ${BINARY} ${LDFLAGS} ./cmd/chronograf/main.go
docker-${BINARY}: $(SOURCES)
CGO_ENABLED=0 GOOS=linux go build -installsuffix cgo -o ${BINARY} ${LDFLAGS} \
./cmd/chronograf/main.go
docker: dep assets docker-${BINARY}
docker build -t chronograf .
assets: js bindata
dev-assets: dev-js bindata
bindata:
go generate -x ./dist
go generate -x ./canned
go generate -x ./server
js:
cd ui && npm run build
dev-js:
cd ui && npm run build:dev
dep: jsdep godep
godep:
go get github.com/sparrc/gdm
gdm restore
go get -u github.com/jteeuwen/go-bindata/...
jsdep:
cd ui && npm install
gen: bolt/internal/internal.proto
go generate -x ./bolt/internal
test: jstest gotest gotestrace
gotest:
go test ./...
gotestrace:
go test -race ./...
jstest:
cd ui && npm test
run: ${BINARY}
./chronograf
run-dev: ${BINARY}
./chronograf -d
clean:
if [ -f ${BINARY} ] ; then rm ${BINARY} ; fi
cd ui && npm run clean
cd ui && rm -rf node_modules
.PHONY: clean test jstest gotest run