docs/contrib/chatwork.md
require 'contrib/chatwork.php';
chatwork_token parameterchatwork_room_id parameterchatwork_notify_text, chatwork_success_text or chatwork_failure_textdeploy.php file# https://deployer.org/recipes.html
require 'recipe/chatwork.php';
Add hook on deploy:
before('deploy', 'chatwork:notify');
chatwork_token – chatwork bot token, requiredchatwork_room_id — chatwork room to push messages to requiredchatwork_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]"
chatwork:notify – send message to chatworkchatwork:notify:success – send success message to chatworkchatwork:notify:failure – send failure message to chatworkIf 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('deploy:success', 'chatwork:notify:success');
If you want to notify about failed deployment add this too:
after('deploy:failed', 'chatwork:notify:failure');
Chatwork settings :::info Required Throws exception if not set. :::
:::info Required Throws exception if not set. :::
return 'https://api.chatwork.com/v2/rooms/' . get('chatwork_room_id') . '/messages';
The Messages
"[info]\n[title](*) Deployment Status: Deploying[/title]\nRepo: {{repository}}\nBranch: {{branch}}\nServer: {{hostname}}\nRelease Path: {{release_path}}\nCurrent Path: {{current_path}}\n[/info]"
"[info]\n[title](*) Deployment Status: Successfully[/title]\nRepo: {{repository}}\nBranch: {{branch}}\nServer: {{hostname}}\nRelease Path: {{release_path}}\nCurrent Path: {{current_path}}\n[/info]"
"[info]\n[title](*) Deployment Status: Failed[/title]\nRepo: {{repository}}\nBranch: {{branch}}\nServer: {{hostname}}\nRelease Path: {{release_path}}\nCurrent Path: {{current_path}}\n[/info]"
Helpers
Tests messages.
Tasks
Notifies Chatwork.
Notifies Chatwork about deploy finish.
Notifies Chatwork about deploy failure.