kit.program/kit/doc/远程模块管理命令.md

43 lines
1.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

```bash
# 验证远程仓库可达
check
# 发行某个模块 eg. myapp
publish myapp
# 列出已安装版本 eg. myapp
list myapp
# 输出:
# 1.0.0
# * 1.2.0 (current)
# 1.2.1
# 安装某个模块 eg. myapp
install myapp
# 切换到版本 1.2.0
use myapp@1.2.0
# 回滚到上一个版本
rollback myapp
# 删除模块
remove myapp
```
## 发布规则
项目 `meta.json` 支持 `group` 字段:
- 默认值为 `/modules`
- 空字符串等同于 `/`
- 可配置为 `/docker`、`/tmpls` 等一级路径,也可配置为 `/docker/net` 等子路径。
- 远程仓库整体上传路径为 `group/id`,其中 `id` 是项目唯一标识。
项目 `meta.json` 只使用 `version` 字段,不再使用 `versions`
- `version` 有值时,按该版本上传;上传前检查远程 `group/id/version` 是否存在,已存在则报错。
- `version` 为空时,先读取远程 `group/id/metadata.json` 中的 `version`,将尾数 +1 后上传。
- 远程没有版本信息时,初始版本号为 `1.0`