https://github.com/fullpipe/herald
Notify someone from some place about your success
https://github.com/fullpipe/herald
grafana grafana-annotations notifications
Last synced: 28 days ago
JSON representation
Notify someone from some place about your success
- Host: GitHub
- URL: https://github.com/fullpipe/herald
- Owner: fullpipe
- License: mit
- Created: 2021-07-02T19:56:00.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-10-31T09:11:04.000Z (over 4 years ago)
- Last Synced: 2025-01-20T17:36:12.899Z (over 1 year ago)
- Topics: grafana, grafana-annotations, notifications
- Language: Go
- Homepage:
- Size: 581 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# herald
Notify someone from some place about your success
## Install
```bash
go install github.com/fullpipe/herald@latest
```
## Usage
```bash
herald help
```
For example we want to notify grafana from local git repository
```bash
export GRAFANA_API_KEY=abirvalg
herald git grafana \
--host https://grafana.example.com:3000 \
--api-key ${GRAFANA_API_KEY} \
--tag TASK-123 --tag release --tag foo-project \
# or you could modify message
herald git grafana \
--host https://grafana.example.com:3000 \
--api-key ${GRAFANA_API_KEY} \
--tag TASK-123 --tag release --tag foo-project \
-m "Project {{.project}} deployed. Going home."
```
| Add anotations | Feel the difference |
| ---------- | :---------- |
|  |  |
## Places
Place tries to generate project metadata if possible.
You could find available place options by `herald PLACE help`
| Place | Description |
| ---------- | :---------- |
| nowhere | set meta as you want |
| git | reads meta from local git repository |
| gitlab | reads meta from gitlab ci env vars |
### Metadata
You could use metadata in message templates. For example:
```gotpl
Project {{.project}} deployed
Project: {{ or .project "none"}}
URL: {{ or .url "none"}}
Branch: {{ or .branch "none"}}
CommitSHA: {{ or .sha "none"}}
Author: {{ or .author "none"}}
```
## Targets
It's where you will see your success.
You could find available target options by `herald nowhere TARGET --help`.
| Target | Description | Required options |
| ---------- | :---------- | :----------- |
| cli | just prints out to your terminal | |
| grafana | creates grafana annotation with tags | `--host`, `--api-key` |
| slack | send message to Slack channel | `--webhook` |
## TODO:
- ci
- wrap in docker container
- error handling
- lint
- commit message as meta.Description?
- more targets
- telegram
- ...
- more places
- github actions
- ...