Skip to content

Commit a34d6c8

Browse files
committed
📚 Add slack documentation
1 parent b4c7671 commit a34d6c8

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
## 🤔 How-tos
1010
* [How to compile assets on deploy using npm?](how-to-npm.md)
11-
* [How to send slack notifications?](how-to-slack.md) (TODO)
11+
* [How to send Slack notifications?](how-to-slack.md)
1212
* [How to deploy directly from server?](how-to-localhost.md)
1313
* [How to deploy with Laravel Forge?](how-to-forge.md)
1414
* [How to reload php-fpm?](how-to-reload-fpm.md)

docs/how-to-slack.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
1-
# How to send slack notifications?
1+
# How to send Slack notifications?
22

3-
TODO
3+
* First you need to require the recipe `recipe/slack.php` to include its tasks and options.
4+
* Then you have to provide your `slack_webhook`. More options are available for customizing the messages, the colors, etc. Check the last section for all available options.
5+
* Then hook the Slack tasks into your deployment flow.
6+
7+
```php
8+
require 'recipe/laravel-deployer.php';
9+
require 'recipe/slack.php';
10+
11+
// ...
12+
13+
set('slack_webhook', 'YOUR_SLACK_WEBHOOK');
14+
before('deploy', 'slack:notify');
15+
after('success', 'slack:notify:success');
16+
after('deploy:failed', 'slack:notify:failure');
17+
```
18+
19+
# Available tasks
20+
21+
| task | description |
22+
| - | - |
23+
| `slack:notify` | Notify about the beginning of deployment. |
24+
| `slack:notify:success` | Notify about successful end of deployment. |
25+
| `slack:notify:failure` | Notify about failed deployment. |
26+
27+
# Available options
28+
29+
| option | default | description |
30+
| - | - | - |
31+
| `slack_webhook` | | **(required)** Slack incoming webhook url. |
32+
| `slack_title` | `{{application}}` | The title of application. |
33+
| `slack_text` | ``_{{user}}_ deploying `{{branch}}` to *{{target}}*`` | Notification message template, markdown supported. |
34+
| `slack_success_text` | `Deploy to *{{target}}* successful` | Success template. |
35+
| `slack_failure_text` | `Deploy to *{{target}}* failed` | Failure template. |
36+
| `slack_color` | `#4d91f7` | Notification's color. |
37+
| `slack_success_color` | `{{slack_color}}` | Success' color. |
38+
| `slack_failure_color` | `#ff0909` | Failure's color. |

0 commit comments

Comments
 (0)