// deploy.php
require 'vendor/deployer/recipes/slack.php';
- slack_skip_notification - Skips the entire task when set to
true
. This is particularly useful if you want to disable slack notifications for certain stages.
- slack (required): accepts an array with the api token and team name. Token can be generated on slack api website.
You can provide also other configuration options:
- message - default is Deployment to
{{host}}
on {{stage}} was successful\n({{release_path}}) - the available placeholders for the message parameter are:
- {{release_path}}
- {{host}}
- {{stage}}
- {{user}}
- {{branch}}
- {{app_name}}
- channel - default is #general
- icon - default is ☀️
- username - default is Deploy
// deploy.php
set('slack', [
'token' => 'xoxp-...',
'team' => 'team name',
'app' => 'app name',
]);
deploy:slack
send message to slack
Since you should only notify Slack channel of a successfull deployment, the deploy:slack
task should be executed right at the end.
// deploy.php
after('deploy', 'deploy:slack');