forked from devdavidkarlsson/grafana-airthings-datasource
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
executable file
·63 lines (49 loc) · 1.58 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
all: install build test lint
# Install dependencies
install: install-frontend install-backend
install-frontend:
yarn install --pure-lockfile
install-backend:
go mod vendor
GO111MODULE=off go get -u golang.org/x/lint/golint
build: build-frontend build-backend
build-frontend:
yarn dev
build-backend:
env GOOS=linux go build -mod=vendor -o ./dist/airthings-plugin_linux_amd64 ./pkg
build-debug:
env GOOS=linux go build -mod=vendor -gcflags=all="-N -l" -o ./dist/airthings-plugin_linux_amd64 ./pkg
env GOOS=darwin go build -mod=vendor -gcflags=all="-N -l" -o ./dist/airthings-plugin_darwin_amd64 ./pkg
run-backend:
# Rebuilds plugin on changes and kill running instance which forces grafana to restart plugin
# See .bra.toml for bra configuration details
bra run
dist: dist-frontend dist-backend
dist-frontend:
yarn build
dist-backend: dist-backend-linux dist-backend-darwin dist-backend-windows
dist-backend-windows: extension = .exe
dist-backend-%:
$(eval filename = airthings-plugin_$*_amd64$(extension))
env GOOS=$* GO111MODULE=on GOARCH=amd64 go build -ldflags="-s -w" -mod=vendor -o ./dist/$(filename) ./pkg
start-frontend:
yarn start
.PHONY: test
test: test-frontend test-backend
test-frontend:
yarn test
test-backend:
go test -v -mod=vendor ./pkg/...
test-ci:
yarn ci-test
mkdir -p tmp/coverage/golang/
go test -race -coverprofile=tmp/coverage/golang/coverage.txt -covermode=atomic -mod=vendor ./pkg/...
.PHONY: clean
clean:
-rm -r ./dist/
.PHONY: lint
lint: lint-frontend lint-backend
lint-frontend:
yarn lint
lint-backend:
golint -min_confidence=1.1 -set_exit_status pkg/...