File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 ` 接口上传单个本地文件。
Original file line number Diff line number Diff line change 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。
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
7887systemd-service-manager init
7988systemd-service-manager list --project /path/to/app
89+ systemd-service-manager list --project /path/to/app --json
8090systemd-service-manager install service api --project /path/to/app
8191systemd-service-manager install api --project /path/to/app --start
8292systemd-service-manager install timer cleanup --project /path/to/app --dry-run
You can’t perform that action at this time.
0 commit comments