- Create telegram bot with BotFather and grab the token provided
- Send
/startto your bot and open https://api.telegram.org/bot{$TELEGRAM_TOKEN_HERE}/getUpdates - Take chat_id from response
Require telegram recipe in your
deploy.phpfile:
require 'recipe/telegram.php';Add hook on deploy:
before('deploy', 'telegram:notify');telegram_token– telegram bot token, requiredtelegram_chat_id— chat ID to push messages totelegram_proxy- proxy connection string in CURLOPT_PROXY form like:http://proxy:80 socks5://user:password@host:3128telegram_title– the title of application, default{{application}}telegram_text– notification message template_{{user}}_ deploying `{{branch}}` to *{{target}}*telegram_success_text– success template, default:Deploy to *{{target}}* successfultelegram_failure_text– failure template, default:Deploy to *{{target}}* failed
telegram:notify– send message to telegramtelegram:notify:success– send success message to telegramtelegram:notify:failure– send failure message to telegram
If you want to notify only about beginning of deployment add this line only:
before('deploy', 'telegram:notify');If you want to notify about successful end of deployment add this too:
after('success', 'telegram:notify:success');If you want to notify about failed deployment add this too:
after('deploy:failed', 'telegram:notify:failure');