pass hook configuration through CLI arguments
This commit is contained in:
@@ -96,21 +96,15 @@ simpleci 提供集成适配器 `pkgs/simpleci/simplegit-hook.sh`。联合部署
|
||||
显式使用该脚本,并配置:
|
||||
|
||||
```sh
|
||||
export SIMPLECI_URL=http://simpleci:8095
|
||||
export SIMPLECI_HOOK_TOKEN=replace-with-a-shared-secret
|
||||
export SIMPLECI_WORKFLOW=.github/workflows/deploy.yml # 可选
|
||||
simplegit daemon -hook-script /path/to/simplegit-hook.sh
|
||||
simplegit daemon \
|
||||
-hook-script=/path/to/simplegit-hook.sh \
|
||||
-hook-arg=--url=http://simpleci:8095 \
|
||||
-hook-arg=--workflow=.github/workflows/deploy.yml \
|
||||
-hook-arg=--
|
||||
```
|
||||
|
||||
tag push 和分支删除不会触发构建;simpleci 不可用时通知最多等待 5 秒,且不影响
|
||||
push 的成功结果。simpleci 使用相同 secret 启动:
|
||||
|
||||
```sh
|
||||
simpleci -hook-token replace-with-a-shared-secret
|
||||
```
|
||||
|
||||
`SIMPLECI_HOOK_TOKEN` 和 `-hook-token` 都为空时不启用鉴权,适合仅在受信任的
|
||||
本机或内部网络开发;生产环境应从同一个 Secret 分别注入两端。
|
||||
push 的成功结果。`POST /runs` 应只暴露在受信任的内部网络。
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user