Merge pull request #137 from trails-cool/feat/grafana-deploy-annotations
Add Grafana deploy annotations to CD workflows
This commit is contained in:
commit
4d8b9a6bb4
3 changed files with 30 additions and 0 deletions
10
.github/workflows/cd-apps.yml
vendored
10
.github/workflows/cd-apps.yml
vendored
|
|
@ -110,3 +110,13 @@ jobs:
|
|||
# Clean up
|
||||
docker image prune -af
|
||||
docker compose ps
|
||||
|
||||
# Annotate deploy in Grafana
|
||||
GRAFANA_TOKEN=$(grep GRAFANA_SERVICE_TOKEN app.env | cut -d= -f2-)
|
||||
if [ -n "$GRAFANA_TOKEN" ]; then
|
||||
docker compose exec -T grafana wget -q -O /dev/null \
|
||||
--header="Authorization: Bearer $GRAFANA_TOKEN" \
|
||||
--header="Content-Type: application/json" \
|
||||
--post-data='{"text":"Deploy '${{ github.sha }}'","tags":["deploy","apps"]}' \
|
||||
http://localhost:3000/api/annotations || true
|
||||
fi
|
||||
|
|
|
|||
10
.github/workflows/cd-brouter.yml
vendored
10
.github/workflows/cd-brouter.yml
vendored
|
|
@ -64,3 +64,13 @@ jobs:
|
|||
docker pull ghcr.io/trails-cool/brouter:latest
|
||||
docker compose up -d brouter
|
||||
docker image prune -af
|
||||
|
||||
# Annotate deploy in Grafana
|
||||
GRAFANA_TOKEN=$(grep GRAFANA_SERVICE_TOKEN .env | cut -d= -f2- 2>/dev/null)
|
||||
if [ -n "$GRAFANA_TOKEN" ]; then
|
||||
docker compose exec -T grafana wget -q -O /dev/null \
|
||||
--header="Authorization: Bearer $GRAFANA_TOKEN" \
|
||||
--header="Content-Type: application/json" \
|
||||
--post-data='{"text":"Deploy brouter ${{ github.sha }}","tags":["deploy","brouter"]}' \
|
||||
http://localhost:3000/api/annotations || true
|
||||
fi
|
||||
|
|
|
|||
10
.github/workflows/cd-infra.yml
vendored
10
.github/workflows/cd-infra.yml
vendored
|
|
@ -85,3 +85,13 @@ jobs:
|
|||
fi
|
||||
|
||||
docker compose ps
|
||||
|
||||
# Annotate deploy in Grafana
|
||||
GRAFANA_TOKEN=$(grep GRAFANA_SERVICE_TOKEN .env | cut -d= -f2-)
|
||||
if [ -n "$GRAFANA_TOKEN" ]; then
|
||||
docker compose exec -T grafana wget -q -O /dev/null \
|
||||
--header="Authorization: Bearer $GRAFANA_TOKEN" \
|
||||
--header="Content-Type: application/json" \
|
||||
--post-data='{"text":"Deploy infra ${{ github.sha }}","tags":["deploy","infra"]}' \
|
||||
http://localhost:3000/api/annotations || true
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue