pass hook configuration through CLI arguments

This commit is contained in:
Jabberwocky238
2026-07-30 01:15:49 -04:00
parent 1e5b0225f5
commit 8d299013f9
4 changed files with 54 additions and 36 deletions
+6 -12
View File
@@ -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` 应只暴露在受信任的内部网络。
---