-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add Makefile with commands for common tasks
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
NAME := grafana-prometheus-alertmanager-datasource | ||
VERSION := $(shell git describe --always) | ||
|
||
## install: Install node dependencies | ||
.PHONY: install | ||
install: | ||
yarn install | ||
|
||
## build: Build plugin | ||
.PHONY: build | ||
build: | ||
yarn run build | ||
|
||
## 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/ build-camptocamp-prometheus-alertmanager-datasource | ||
zip -r build/camptocamp-prometheus-alertmanager-datasource-${VERSION}.zip ./build-camptocamp-prometheus-alertmanager-datasource | ||
md5sum build/camptocamp-prometheus-alertmanager-datasource-${VERSION}.zip > build/camptocamp-prometheus-alertmanager-datasource-${VERSION}.zip.md5 | ||
rm -r build-camptocamp-prometheus-alertmanager-datasource | ||
|
||
## run-dev: Build and run Docker dev container on port 3000 | ||
.PHONY: run-dev | ||
run-dev: build | ||
docker run -d \ | ||
-e GF_DEFAULT_APP_MODE=development \ | ||
-p 3000:3000 \ | ||
-v ${PWD}:/var/lib/grafana/plugins \ | ||
grafana/grafana:8.5.2 | ||
|
||
|
||
.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 |