baachi / deployer-rocketchat-recipe
1.0.0
2019-06-24 23:09 UTC
Requires
- php: ~7.0
Requires (Dev)
- deployer/deployer: ^6.3
This package is auto-updated.
Last update: 2022-08-04 18:02:53 UTC
README
⚠️ 此包已被弃用,请使用官方配方。
安装
通过管理面板创建RockChat接收Webhook。
通过composer安装此配方。
$ composer require baachi/rocketchat-recipe
将新配方引入到你的deploy.php
文件中。
require 'vendor/baachi/rocketchat-recipe/rockchat.php';
在部署时添加钩子。
before('deploy', 'rockchat:notify');
配置
-
rocketchat_webhook
- 接收RockChat Webhook 必需set('rocketchat_webook', 'https://rocketchat.yourcompany.com/hooks/XXXXX');
-
rocketchat_title
- 应用的标题,默认为{{application}}
-
rocketchat_text
- 通知消息set('rocketchat_text', '_{{user}}_ deploying {{branch}} to {{target}}');
-
rocketchat_success_text
– 成功模板,默认
set('rocketchat_success_text', 'Deploy to *{{target}}* successful');
rocketchat_failure_text
– 失败模板,默认
set('rocketchat_failure_text', 'Deploy to *{{target}}* failed');
rocketchat_color
– 附件颜色rocketchat_success_color
– 成功颜色附件rocketchat_failure_color
– 失败颜色附件
任务
rocketchat:notify
– 向rocketchat发送消息rocketchat:notify:success
– 向rocketchat发送成功消息rocketchat:notify:failure
– 向rocketchat发送失败消息
用法
如果你只想通知部署的开始,只需添加此行即可
before('deploy', 'rocketchat:notify');
如果你想通知部署成功的结束,也添加此行
after('success', 'rocketchat:notify:success');
如果你想通知部署失败,也添加此行
after('deploy:failed', 'rocketchat:notify:failure');