deployer/docs/contrib/yammer.md
Anton Medvedev 6113e5e4f5 Improve docs
2022-09-12 12:53:42 +02:00

141 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- 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.