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

131 lines
2.5 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/hangouts.php -->
<!-- Then run bin/docgen -->
# Hangouts Recipe
```php
require 'contrib/hangouts.php';
```
[Source](/contrib/hangouts.php)
Add hook on deploy:
```php
before('deploy', 'chat:notify');
```
## Configuration
- `chat_webhook` chat incoming webhook url, **required**
- `chat_title` the title of your notification card, default `{{application}}`
- `chat_subtitle` the subtitle of your card, default `{{hostname}}`
- `chat_favicon` an image for the header of your card, default `http://{{hostname}}/favicon.png`
- `chat_line1` first line of the text in your card, default: `{{branch}}`
- `chat_line2` second line of the text in your card, default: `{{stage}}`
## Usage
If you want to notify only about beginning of deployment add this line only:
```php
before('deploy', 'chat:notify');
```
If you want to notify about successful end of deployment add this too:
```php
after('deploy:success', 'chat:notify:success');
```
If you want to notify about failed deployment add this too:
```php
after('deploy:failed', 'chat:notify:failure');
```
## Configuration
### chat_title
[Source](https://github.com/deployphp/deployer/blob/master/contrib/hangouts.php#L45)
Title of project
```php title="Default value"
return get('application', 'Project');
```
### chat_subtitle
[Source](https://github.com/deployphp/deployer/blob/master/contrib/hangouts.php#L49)
```php title="Default value"
get('hostname')
```
### favicon
[Source](https://github.com/deployphp/deployer/blob/master/contrib/hangouts.php#L52)
If 'favicon' is set Google Hangouts Chat will decorate your card with an image.
```php title="Default value"
'http://{{hostname}}/favicon.png'
```
### chat_line1
[Source](https://github.com/deployphp/deployer/blob/master/contrib/hangouts.php#L55)
Deploy messages
```php title="Default value"
'{{branch}}'
```
### chat_line2
[Source](https://github.com/deployphp/deployer/blob/master/contrib/hangouts.php#L56)
```php title="Default value"
'{{stage}}'
```
## Tasks
### chat:notify
[Source](https://github.com/deployphp/deployer/blob/master/contrib/hangouts.php#L59)
Notifies Google Hangouts Chat.
### chat:notify:success
[Source](https://github.com/deployphp/deployer/blob/master/contrib/hangouts.php#L101)
Notifies Google Hangouts Chat about deploy finish.
### chat:notify:failure
[Source](https://github.com/deployphp/deployer/blob/master/contrib/hangouts.php#L143)
Notifies Google Hangouts Chat about deploy failure.