Back to Deployer

Rocketchat Recipe

docs/contrib/rocketchat.md

8.0.34.2 KB
Original Source
<!-- DO NOT EDIT THIS FILE! --> <!-- Instead edit contrib/rocketchat.php --> <!-- Then run bin/docgen -->

Rocketchat Recipe

php
require 'contrib/rocketchat.php';

Source

Installing

Create a RocketChat incoming webhook, through the administration panel. Add hook on deploy:

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

Configuration

  • rocketchat_webhook - incoming rocketchat webook required
    set('rocketchat_webhook', 'https://rocketchat.yourcompany.com/hooks/XXXXX');
    
  • rocketchat_title - the title of the application, defaults to {{application}}
  • rocketchat_text - notification message
    set('rocketchat_text', '_{{user}}_ deploying {{what}} to {{where}}');
    
  • rocketchat_success_text – success template, default:
set('rocketchat_success_text', 'Deploy to *{{where}}* successful');
  • rocketchat_failure_text – failure template, default:
set('rocketchat_failure_text', 'Deploy to *{{where}}* failed');
  • rocketchat_color – color's attachment
  • rocketchat_success_color – success color's attachment
  • rocketchat_failure_color – failure color's attachment

Usage

If you want to notify only about beginning of deployment add this line only:

php
before('deploy', 'rocketchat:notify');

If you want to notify about successful end of deployment add this too:

php
after('deploy:success', 'rocketchat:notify:success');

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

php
after('deploy:failed', 'rocketchat:notify:failure');

Configuration

rockchat_title

Source

php
return get('application', 'Project');

rocketchat_icon_emoji

Source

php
':robot:'

rocketchat_icon_url

Source

php
null

rocketchat_channel

Source

php
null

rocketchat_room_id

Source

php
null

rocketchat_username

Source

php
null

rocketchat_webhook

Source

php
null

rocketchat_color

Source

php
'#000000'

rocketchat_success_color

Source

php
'#00c100'

rocketchat_failure_color

Source

php
'#ff0909'

rocketchat_text

Source

php
'_{{user}}_ deploying `{{what}}` to *{{where}}*'

rocketchat_success_text

Source

php
'Deploy to *{{where}}* successful'

rocketchat_failure_text

Source

php
'Deploy to *{{where}}* failed'

Tasks

rocketchat:notify {#rocketchat-notify}

Source

Notifies RocketChat.

rocketchat:notify:success {#rocketchat-notify-success}

Source

Notifies RocketChat about deploy finish.

rocketchat:notify:failure {#rocketchat-notify-failure}

Source

Notifies RocketChat about deploy failure.