-
Notifications
You must be signed in to change notification settings - Fork 58
/
Makefile
55 lines (47 loc) · 1.36 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
NAME := camptocamp-prometheus-alertmanager-datasource
VERSION := $(shell git describe --tags --abbrev=0)
## install: Install node dependencies
.PHONY: install
install:
yarn install
## build: Build plugin
.PHONY: build
build:
yarn run build
## build-dev: Build plugin in dav mode (allow console logs)
.PHONY: build-dev
build-dev:
yarn run dev
## sign: Sign plugin
.PHONY: sign
sign:
yarn sign
## release: Make a release of the plugin
.PHONY: release
release: install build sign
mkdir build
mv dist/ camptocamp-prometheus-alertmanager-datasource
zip -r build/camptocamp-prometheus-alertmanager-datasource-${VERSION}.zip ./camptocamp-prometheus-alertmanager-datasource
md5sum build/camptocamp-prometheus-alertmanager-datasource-${VERSION}.zip > build/camptocamp-prometheus-alertmanager-datasource-${VERSION}.zip.md5
rm -r camptocamp-prometheus-alertmanager-datasource
## run-dev: Build and run Docker dev container on port 3000
.PHONY: run-dev
run-dev: install build-dev
docker run -d \
-e GF_DEFAULT_APP_MODE=development \
-p 3000:3000 \
-v ${PWD}:/var/lib/grafana/plugins \
grafana/grafana:8.5.2
## clean: Clean build directory
.PHONY: clean
clean:
rm -rf dist
rm -rf build
.PHONY: help
all: help
help: Makefile
@echo
@echo " Choose a command to run in "$(NAME)":"
@echo
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo