2020-10-02 00:11:13 +02:00
|
|
|
|
<!-- DO NOT EDIT THIS FILE! -->
|
|
|
|
|
<!-- Instead edit contrib/grafana.php -->
|
|
|
|
|
<!-- Then run bin/docgen -->
|
|
|
|
|
|
|
|
|
|
# grafana
|
|
|
|
|
|
|
|
|
|
[Source](/contrib/grafana.php)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Installing
|
|
|
|
|
|
|
|
|
|
Add to your _deploy.php_
|
|
|
|
|
|
|
|
|
|
```php
|
|
|
|
|
require 'contrib/grafana.php';
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Configuration options
|
|
|
|
|
|
|
|
|
|
- **url** *(required)*: the URL to the creates annotation api endpoint.
|
|
|
|
|
- **token** *(required)*: authentication token. Can be created at Grafana Console.
|
|
|
|
|
- **time** *(optional)* – set deploy time of annotation. specify epoch milliseconds. (Defaults is set to the current time in epoch milliseconds.)
|
|
|
|
|
- **tags** *(optional)* – set tag of annotation.
|
|
|
|
|
- **text** *(optional)* – set text of annotation. (Defaults is set to "Deployed " + git log -n 1 --format="%h")
|
|
|
|
|
|
|
|
|
|
```php
|
|
|
|
|
deploy.php
|
|
|
|
|
|
|
|
|
|
set('grafana', [
|
|
|
|
|
'token' => 'eyJrIj...',
|
|
|
|
|
'url' => 'http://grafana/api/annotations',
|
|
|
|
|
'tags' => ['deploy', 'production'],
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
|
|
If you want to create annotation about successful end of deployment.
|
|
|
|
|
|
|
|
|
|
```php
|
2020-10-29 23:16:36 +01:00
|
|
|
|
after('deploy:success', 'grafana:annotation');
|
2020-10-02 00:11:13 +02:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Tasks
|
|
|
|
|
* [`grafana:annotation`](#grafanaannotation) — Create Grafana annotation of deployment
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Tasks
|
|
|
|
|
### grafana:annotation
|
2020-11-16 00:00:20 +01:00
|
|
|
|
[Source](https://github.com/deployphp/deployer/search?q=grafana%3Aannotation+in%3Afile+language%3Aphp+path%3Acontrib+filename%3Agrafana.php)
|
2020-10-02 00:11:13 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|