Skip to content

Commit 3b76838

Browse files
committed
docs(bash): 更新构建与 systemd 管理器说明
1 parent 4a6cce6 commit 3b76838

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

scripts/bash/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
这里存放以 `bash` 为运行时的轻量单文件脚本。
44

5+
## Build
6+
7+
```bash
8+
scripts/bash/build.sh
9+
scripts/bash/build.sh --jobs 2
10+
scripts/bash/build.sh --list
11+
scripts/bash/build.sh --only aliyun-oss-put
12+
```
13+
14+
`scripts/bash/build.sh` 统一刷新 Bash 工具的 `bin` 产物。目录型工具通过自己的 `build.sh` 生成产物;单文件 `.sh` 会复制到 `bin/<name>`,默认去掉 `.sh` 扩展。
15+
516
## aliyun-oss-put.sh
617

718
使用阿里云 OSS `PutObject` 接口上传单个本地文件。

scripts/bash/systemd-service-manager/README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
## Commands
66

77
- `init`:在项目目录下生成 `deploy/systemd/` 骨架、`README.md``*.example` 和默认可编辑配置。
8-
- `list`:列出项目中声明的 services 与 timers,方便确认命名和管理范围。
8+
- `list`:列出项目中声明的 services 与 timers,方便确认命名和管理范围;支持 `--json` 输出稳定结构
99
- `install`:把 `.conf` / `.env` 渲染成 `.service` / `.timer`,并安装到 systemd 目录;支持 `--dry-run` 预览。
1010
- `uninstall`:删除当前工具生成的 unit 文件。
1111
- `start`:启动指定 service 或 timer。
@@ -40,6 +40,15 @@
4040
- `project.env.local`
4141
- `project.env`
4242

43+
## Timer task retry
44+
45+
Timer task 可选配置:
46+
47+
- `RETRY_ATTEMPTS`:命令总尝试次数,默认 `1`,即不重试。
48+
- `RETRY_DELAY_SEC`:失败后等待秒数,默认 `5`
49+
50+
`RETRY_ATTEMPTS` 只适用于 `TARGET_TYPE=task`,不适用于触发 service 的 timer。
51+
4352
## fnm 推荐写法
4453

4554
对于 `system` scope 的 Node / fnm 工具,推荐在 env 文件里提供稳定的 `PATH``HOME`,不要使用 `/run/user/.../fnm_multishells/...` 这类会话级临时路径。
@@ -77,6 +86,7 @@ bash scripts/bash/systemd-service-manager/build.sh
7786
```bash
7887
systemd-service-manager init
7988
systemd-service-manager list --project /path/to/app
89+
systemd-service-manager list --project /path/to/app --json
8090
systemd-service-manager install service api --project /path/to/app
8191
systemd-service-manager install api --project /path/to/app --start
8292
systemd-service-manager install timer cleanup --project /path/to/app --dry-run

0 commit comments

Comments
 (0)