mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-22 08:12:29 +01:00
3.2 KiB
3.2 KiB
Discord Recipe
require 'contrib/discord.php';
Installing
Add hook on deploy:
before('deploy', 'discord:notify');
Configuration
-
discord_channel
– Discord channel ID, required -
discord_token
– Discord channel token, required -
discord_notify_text
– notification message template, markdown supported, default::​information_source: **{{user}}** is deploying branch `{{branch}}` to _{{target}}_
-
discord_success_text
– success template, default::​white_check_mark: Branch `{{branch}}` deployed to _{{target}}_ successfully
-
discord_failure_text
– failure template, default::​no_entry_sign: Branch `{{branch}}` has failed to deploy to _{{target}}_
Usage
If you want to notify only about beginning of deployment add this line only:
before('deploy', 'discord:notify');
If you want to notify about successful end of deployment add this too:
after('deploy:success', 'discord:notify:success');
If you want to notify about failed deployment add this too:
after('deploy:failed', 'discord:notify:failure');
Configuration
discord_webhook
return 'https://discordapp.com/api/webhooks/{{discord_channel}}/{{discord_token}}/slack';
discord_notify_text
Deploy messages
return [
'text' => parse(':​information_source: **{{user}}** is deploying branch `{{branch}}` to _{{target}}_'),
];
discord_success_text
return [
'text' => parse(':​white_check_mark: Branch `{{branch}}` deployed to _{{target}}_ successfully'),
];
discord_failure_text
return [
'text' => parse(':​no_entry_sign: Branch `{{branch}}` has failed to deploy to _{{target}}_'),
];
discord_message
The message
'discord_notify_text'
Tasks
discord_send_message
Helpers
discord:test
Tests messages.
Tasks
discord:notify
Notifies Discord.
discord:notify:success
Notifies Discord about deploy finish.
discord:notify:failure
Notifies Discord about deploy failure.