curder / deployphp-recipes

钉钉通知的Deployer部署脚本。

1.0.3 2019-03-01 06:17 UTC

This package is auto-updated.

Last update: 2024-08-29 05:00:19 UTC


README

使用

本项目是Deployer的部署通知插件,因此在使用前请确保您已安装好deployer/deployer(建议您完成一次成功部署后再进行配置)。

composer require curder/deployphp-recipes --dev # 当前项目安装

在您的部署配置文件deploy.php中添加以下代码引入:

require __DIR__.'/vendor/curder/deployphp-recipes/dingtalk.php';

配置

修改本地部署文件,添加以下语句:

// config access token value
set('dingtalk_access_token', '');

// DingTalk text
set('dingtalk_text', '_{{user}}_正在部署**{{ target }}**, 从`{{branch}}`分支部署到*{{target}}*');
set('dingtalk_failure_text', '**{{ branch }}**部署到*{{target}}*失败');
set('dingtalk_success_text', '**{{ branch }}**部署到*{{target}}*成功');

// Handle notify
after('deploy:info', 'dingtalk:notify');
after('success', 'dingtalk:notify:success');
after('deploy:failed', 'dingtalk:notify:failure');

获取对应通知到的钉钉群的token值,获取方式请通过以下网址进行。将上述代码中的domain.com替换为您可识别的部署目标网址。

更多第三方插件【参考这里

参考链接