diff --git a/README.md b/README.md index 4ab0afd9..6f690226 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ await executor.run(options) node index.js ``` 5. 执行效果 - +生成的证书默认会存储在 `${home}/.certd/${email}/certs/${domain}/current`目录下 ``` [2021-01-08T16:15:04.681] [INFO] certd - 任务完成 [2021-01-08T16:15:04.681] [INFO] certd - ---------------------------任务结果总览-------------------------- @@ -97,3 +97,31 @@ node index.js [2021-01-08T16:15:04.682] [INFO] certd - └【上传到阿里云】-------------------------------- [success] 执行成功 [2021-01-08T16:15:04.682] [INFO] certd - └【部署证书到CDN】------------------------------- [success] 执行成功 ``` +第一次运行会记住成功后的结果,成功过的任务不会重复执行 + +## CI/DI集成与自动续期重新部署 +集成前,将以上代码提交到内网git仓库,或者私有git仓库(由于包含敏感信息,不要提交到公开git仓库) + +### jenkins任务 +1. 创建任务 +选择构建自由风格的任务 + +2. 配置git +配置cert-run的git地址 + +3. 构建触发器 +配置 `H 0 3 * * ` ,每天凌晨3天执行一次 + +4. 构建环境 +勾选 `Provide Node & npm bin/ folder to PATH`,提供nodejs运行环境 +如果没有此选项,需要jenkins安装`nodejs`插件 + +5. 构建 +执行shell +``` +npm install --production #执行过一次之后,就可以注释掉,加快执行速度 +npm run post +``` +6. 构建后操作 +邮件通知 +配置你的邮箱地址,可以在执行失败时收到邮件通知。