deployer/docs/contrib/slack.md
Anton Medvedev 47a193f9af
Add docgen
2020-10-02 01:11:13 +03:00

3.3 KiB
Raw Blame History

slack

Source

Installing

Add to Slack

Require slack recipe in your deploy.php file:

require 'contrib/slack.php';

Add hook on deploy:

before('deploy', 'slack:notify');

Configuration

  • slack_webhook slack incoming webhook url, required

    set('slack_webhook', 'https://hooks.slack.com/...');
    
  • slack_title the title of application, default {{application}}

  • slack_text notification message template, markdown supported

    set('slack_text', '_{{user}}_ deploying `{{branch}}` to *{{target}}*');
    
  • slack_success_text success template, default:

    set('slack_success_text', 'Deploy to *{{target}}* successful');
    
  • slack_failure_text failure template, default:

    set('slack_failure_text', 'Deploy to *{{target}}* failed');
    
  • slack_color color's attachment

  • slack_success_color success color's attachment

  • slack_failure_color failure color's attachment

Usage

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('success', 'slack:notify:success');

If you want to notify about failed deployment add this too:

after('deploy:failed', 'slack:notify:failure');

Config

slack_title

Source

Title of project

slack_text

Source

Deploy message

slack_success_text

Source

slack_failure_text

Source

slack_rollback_text

Source

slack_color

Source

Color of attachment

slack_success_color

Source

slack_failure_color

Source

slack_rollback_color

Source

Tasks

slack:notify

Source

slack:notify:success

Source

slack:notify:failure

Source

slack:notify:rollback

Source