docs/contrib/slack.md
require 'contrib/slack.php';
<a href="https://slack.com/oauth/authorize?&client_id=113734341365.225973502034&scope=incoming-webhook"></a> Add hook on deploy:
before('deploy', 'slack:notify');
slack_webhook – slack incoming webhook url, required
set('slack_webhook', 'https://hooks.slack.com/...');
slack_channel - channel to send notification to. The default is the channel configured in the webhookslack_title – the title of application, default {{application}}slack_text – notification message template, markdown supported
set('slack_text', '_{{user}}_ deploying `{{what}}` to *{{where}}*');
slack_success_text – success template, default:
set('slack_success_text', 'Deploy to *{{where}}* successful');
slack_failure_text – failure template, default:
set('slack_failure_text', 'Deploy to *{{where}}* failed');
slack_color – color's attachmentslack_success_color – success color's attachmentslack_failure_color – failure color's attachmentslack_fields - set attachments fields for pretty output in Slack, default:
set('slack_fields', []);
If you want to notify only about beginning of deployment add this line only:
before('deploy', 'slack:notify');
If you want to notify about successful end of deployment add this too:
after('deploy:success', 'slack:notify:success');
If you want to notify about failed deployment add this too:
after('deploy:failed', 'slack:notify:failure');
Channel to publish to, when false the default channel the webhook will be used
false
Title of project
return get('application', 'Project');
Deploy message
'_{{user}}_ deploying `{{what}}` to *{{where}}*'
'Deploy to *{{where}}* successful'
'Deploy to *{{where}}* failed'
'_{{user}}_ rolled back changes on *{{where}}*'
Color of attachment
'#4d91f7'
'#00c100'
'#ff0909'
'#eba211'
Notifies Slack.
Notifies Slack about deploy finish.
Notifies Slack about deploy failure.
Notifies Slack about rollback.