Skip to main content
Version: 7.x

chatwork

Source

Chatwork Recipe

Installing

  1. Create chatwork account by any manual in the internet
  2. Take chatwork token (Like: b29a700e2d15bef3f26ae6a5c142d1ea) and set chatwork_token parameter
  3. Take chatwork room id from url after clicked on the room, and set chatwork_room_id parameter
  4. If you want, you can edit chatwork_notify_text, chatwork_success_text or chatwork_failure_text
  5. Require chatwork recipe in your deploy.php file
# https://deployer.org/recipes.html

require 'recipe/chatwork.php';

Add hook on deploy:

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

Configuration

  • chatwork_token โ€“ chatwork bot token, required
  • chatwork_room_id โ€” chatwork room to push messages to required
  • chatwork_notify_text โ€“ notification message template
    [info]
    [title](*) Deployment Status: Deploying[/title]
    Repo: {{repository}}
    Branch: {{branch}}
    Server: {{hostname}}
    Release Path: {{release_path}}
    Current Path: {{current_path}}
    [/info]
  • chatwork_success_text โ€“ success template, default:
    [info]
    [title](*) Deployment Status: Successfully[/title]
    Repo: {{repository}}
    Branch: {{branch}}
    Server: {{hostname}}
    Release Path: {{release_path}}
    Current Path: {{current_path}}
    [/info]"
  • chatwork_failure_text โ€“ failure template, default:
    [info]
    [title](*) Deployment Status: Failed[/title]
    Repo: {{repository}}
    Branch: {{branch}}
    Server: {{hostname}}
    Release Path: {{release_path}}
    Current Path: {{current_path}}
    [/info]"

Tasks

  • chatwork:notify โ€“ send message to chatwork
  • chatwork:notify:success โ€“ send success message to chatwork
  • chatwork:notify:failure โ€“ send failure message to chatwork

Usage

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

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

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

after('success', 'chatwork:notify:success');

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

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

Configuration

chatwork_token

Source

Chatwork settings

chatwork_room_id

Source

chatwork_api

Source

chatwork_notify_text

Source

The Messages

Default value
"[info]\n[title](*) Deployment Status: Deploying[/title]\nRepo: {{repository}}\nBranch: {{branch}}\nServer: {{hostname}}\nRelease Path: {{release_path}}\nCurrent Path: {{current_path}}\n[/info]"

chatwork_success_text

Source

Default value
"[info]\n[title](*) Deployment Status: Successfully[/title]\nRepo: {{repository}}\nBranch: {{branch}}\nServer: {{hostname}}\nRelease Path: {{release_path}}\nCurrent Path: {{current_path}}\n[/info]"

chatwork_failure_text

Source

Default value
"[info]\n[title](*) Deployment Status: Failed[/title]\nRepo: {{repository}}\nBranch: {{branch}}\nServer: {{hostname}}\nRelease Path: {{release_path}}\nCurrent Path: {{current_path}}\n[/info]"

Tasks

chatwork_send_message

Source

Helpers

chatwork:test

Source

Tests messages.

Tasks

chatwork:notify

Source

Notifies Chatwork.

chatwork:notify:success

Source

Notifies Chatwork about deploy finish.

chatwork:notify:failure

Source

Notifies Chatwork about deploy failure.



Support Deployer โค๏ธ

Hello, my name is Anton Medvedev (@antonmedv). I'm the creator of the Deployer. I maintain this open source project in my spare time. Supporters on GitHub give me extra motivation to work on the project.

Consider supporting Deployer via GitHub Sponsors.

Also, please, nominate me for GitHub Stars award. Thanks!