forked from deployphp/deployer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathraygun.php
48 lines (38 loc) · 1.3 KB
/
raygun.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/*
## Installing
Add to your _deploy.php_
```php
require 'contrib/raygun.php';
```
## Configuration
- `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');
```
*/
namespace Deployer;
use Deployer\Utility\Httpie;
desc('Notifying Raygun of deployment');
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')
->body($data)
->send();
});