-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
51 lines (40 loc) · 1.21 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
GRAFANA_PLUGIN_ID := $(shell cat src/plugin.json | jq -r .id)
GRAFANA_PLUGIN_VERSION := $(shell cat package.json| jq -r '.version')
GRAFANA_PLUGIN_TYPE := $(shell cat src/plugin.json | jq -r .type)
MD5CMD ?= "md5"
clean:
mage clean
rm -f dist
test:
yarn test
mage test
setup:
yarn install
yarn build
go get -u github.com/grafana/grafana-plugin-sdk-go
go mod tidy
build:
@yarn build
@mage -v
build-with-docker:
@docker compose run --remove-orphans go-builder
@docker compose run --remove-orphans js-builder
run:
@docker compose up grafana
package_node:
@yarn install --pure-lockfile
@yarn build
check_os:
@if [ -z "${OS}" ]; then echo "OS not set. Please run \`make {linux,windows,darwin} package\`"; exit 1; fi ||:
linux:
@:$(eval OS=linux)
@:$(eval GRAFANA_PLUGIN_ARTIFACT="${GRAFANA_PLUGIN_ID}-${GRAFANA_PLUGIN_VERSION}-${OS}.zip")
@:$(eval GRAFANA_PLUGIN_ARTIFACT_CHECKSUM="${GRAFANA_PLUGIN_ARTIFACT}.md5")
package: check_os package_node
@mage build:${OS}
@yarn sign
@mv dist/ ${GRAFANA_PLUGIN_ID}
@zip ${GRAFANA_PLUGIN_ARTIFACT} ${GRAFANA_PLUGIN_ID} -r
@$(MD5CMD) ${GRAFANA_PLUGIN_ARTIFACT} > ${GRAFANA_PLUGIN_ARTIFACT_CHECKSUM}
@plugincheck ${GRAFANA_PLUGIN_ARTIFACT}
@rm -r ${GRAFANA_PLUGIN_ID}