Back to Deployer

Hangouts Recipe

docs/contrib/hangouts.md

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

Hangouts Recipe

php
require 'contrib/hangouts.php';

Source

Add hook on deploy:

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

Configuration

  • chat_webhook – chat incoming webhook url, required
  • chat_title – the title of your notification card, default {{application}}
  • chat_subtitle – the subtitle of your card, default {{hostname}}
  • chat_favicon – an image for the header of your card, default http://{{hostname}}/favicon.png
  • chat_line1 – first line of the text in your card, default: {{branch}}
  • chat_line2 – second line of the text in your card, default: {{stage}}

Usage

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

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

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

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

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

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

Configuration

chat_title

Source

Title of project

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

chat_subtitle

Source

php
get('hostname')

favicon

Source

If 'favicon' is set Google Hangouts Chat will decorate your card with an image.

php
'http://{{hostname}}/favicon.png'

chat_line1

Source

Deploy messages

php
'{{branch}}'

chat_line2

Source

php
'{{stage}}'

Tasks

chat:notify {#chat-notify}

Source

Notifies Google Hangouts Chat.

chat:notify:success {#chat-notify-success}

Source

Notifies Google Hangouts Chat about deploy finish.

chat:notify:failure {#chat-notify-failure}

Source

Notifies Google Hangouts Chat about deploy failure.