deployer/contrib/raygun.php

42 lines
1.2 KiB
PHP
Raw Normal View History

2020-04-25 23:00:08 +03:00
<?php
2020-10-02 00:11:13 +02:00
/*
## Configuration
2020-04-25 23:00:08 +03:00
2020-10-02 00:11:13 +02:00
- `raygun_api_key` the API key of your Raygun application
- `raygun_version` the version of your application that this deployment is releasing
- `raygun_owner_name` the name of the person creating this deployment
- `raygun_email` the email of the person creating this deployment
- `raygun_comment` the deployment notes
- `raygun_scm_identifier` the commit that this deployment was built off
- `raygun_scm_type` - the source control system you use
## Usage
To notify Raygun of a successful deployment, you can use the 'raygun:notify' task after a deployment.
```php
after('deploy', 'raygun:notify');
```
*/
2020-04-25 23:00:08 +03:00
namespace Deployer;
use Deployer\Utility\Httpie;
2021-11-08 22:59:39 +01:00
desc('Notifies Raygun of deployment');
2020-04-25 23:00:08 +03:00
task('raygun:notify', function () {
$data = [
'apiKey' => get('raygun_api_key'),
'version' => get('raygun_version'),
'ownerName' => get('raygun_owner_name'),
'emailAddress' => get('raygun_email'),
'comment' => get('raygun_comment'),
'scmIdentifier' => get('raygun_scm_identifier'),
'scmType' => get('raygun_scm_type')
];
Httpie::post('https://app.raygun.io/deployments')
2021-11-07 10:49:16 +01:00
->jsonBody($data)
2020-04-25 23:00:08 +03:00
->send();
2020-10-02 00:11:13 +02:00
});