mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-23 00:32:25 +01:00
141 lines
2.7 KiB
Markdown
141 lines
2.7 KiB
Markdown
<!-- DO NOT EDIT THIS FILE! -->
|
||
<!-- Instead edit contrib/yammer.php -->
|
||
<!-- Then run bin/docgen -->
|
||
|
||
# Yammer Recipe
|
||
|
||
```php
|
||
require 'contrib/yammer.php';
|
||
```
|
||
|
||
[Source](/contrib/yammer.php)
|
||
|
||
|
||
|
||
|
||
Add hook on deploy:
|
||
|
||
```php
|
||
before('deploy', 'yammer:notify');
|
||
```
|
||
|
||
## Configuration
|
||
|
||
- `yammer_url` – The URL to the message endpoint, default is https://www.yammer.com/api/v1/messages.json
|
||
- `yammer_token` *(required)* – Yammer auth token
|
||
- `yammer_group_id` *(required)* - Group ID
|
||
- `yammer_title` – the title of application, default `{{application}}`
|
||
- `yammer_body` – notification message template, default:
|
||
```
|
||
<em>{{user}}</em> deploying {{branch}} to <strong>{{target}}</strong>
|
||
```
|
||
- `yammer_success_body` – success template, default:
|
||
```
|
||
Deploy to <strong>{{target}}</strong> successful
|
||
```
|
||
- `yammer_failure_body` – failure template, default:
|
||
```
|
||
Deploy to <strong>{{target}}</strong> failed
|
||
```
|
||
|
||
## Usage
|
||
|
||
If you want to notify only about beginning of deployment add this line only:
|
||
|
||
```php
|
||
before('deploy', 'yammer:notify');
|
||
```
|
||
|
||
If you want to notify about successful end of deployment add this too:
|
||
|
||
```php
|
||
after('deploy:success', 'yammer:notify:success');
|
||
```
|
||
|
||
If you want to notify about failed deployment add this too:
|
||
|
||
```php
|
||
after('deploy:failed', 'yammer:notify:failure');
|
||
```
|
||
|
||
|
||
|
||
## Configuration
|
||
### yammer_url
|
||
[Source](https://github.com/deployphp/deployer/blob/master/contrib/yammer.php#L54)
|
||
|
||
|
||
|
||
```php title="Default value"
|
||
'https://www.yammer.com/api/v1/messages.json'
|
||
```
|
||
|
||
|
||
### yammer_title
|
||
[Source](https://github.com/deployphp/deployer/blob/master/contrib/yammer.php#L57)
|
||
|
||
Title of project
|
||
|
||
```php title="Default value"
|
||
return get('application', 'Project');
|
||
```
|
||
|
||
|
||
### yammer_body
|
||
[Source](https://github.com/deployphp/deployer/blob/master/contrib/yammer.php#L62)
|
||
|
||
Deploy message
|
||
|
||
```php title="Default value"
|
||
'<em>{{user}}</em> deploying {{branch}} to <strong>{{target}}</strong>'
|
||
```
|
||
|
||
|
||
### yammer_success_body
|
||
[Source](https://github.com/deployphp/deployer/blob/master/contrib/yammer.php#L63)
|
||
|
||
|
||
|
||
```php title="Default value"
|
||
'Deploy to <strong>{{target}}</strong> successful'
|
||
```
|
||
|
||
|
||
### yammer_failure_body
|
||
[Source](https://github.com/deployphp/deployer/blob/master/contrib/yammer.php#L64)
|
||
|
||
|
||
|
||
```php title="Default value"
|
||
'Deploy to <strong>{{target}}</strong> failed'
|
||
```
|
||
|
||
|
||
|
||
## Tasks
|
||
|
||
### yammer:notify
|
||
[Source](https://github.com/deployphp/deployer/blob/master/contrib/yammer.php#L67)
|
||
|
||
Notifies Yammer.
|
||
|
||
|
||
|
||
|
||
### yammer:notify:success
|
||
[Source](https://github.com/deployphp/deployer/blob/master/contrib/yammer.php#L86)
|
||
|
||
Notifies Yammer about deploy finish.
|
||
|
||
|
||
|
||
|
||
### yammer:notify:failure
|
||
[Source](https://github.com/deployphp/deployer/blob/master/contrib/yammer.php#L105)
|
||
|
||
Notifies Yammer about deploy failure.
|
||
|
||
|
||
|
||
|