Skip to content

Instantly share code, notes, and snippets.

- task: Bash@3
inputs:
targetType: 'inline'
script: |
EPOCH=$(($(date +%s%N)/1000000))
curl -X POST $(grafana_api_endpoint)/annotations -H 'Content-Type: application/json' -H 'Authorization:Bearer $(grafana_annotations_key)' -d '{"created": '"$EPOCH"', "updated": '"$EPOCH"', "time": '"$EPOCH"', "timeEnd": '"$EPOCH"',"text": "Deployment", "tags": ["kind:deployment","project:'"$(Build.Repository.Name)"'"]}'