@gbits-jszx/dg-cli 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -0
- package/package.json +6 -6
package/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# @gbits-jszx/dg-cli
|
|
2
|
+
|
|
3
|
+
DataGateway CLI — 部署 / 运维 / 配置一站式工具,Go 二进制经由 npx 分发。
|
|
4
|
+
|
|
5
|
+
## 安装与使用
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# 一次性运行(推荐,--prefer-online 确保拉最新版)
|
|
9
|
+
npx -y --prefer-online @gbits-jszx/dg-cli@latest doctor
|
|
10
|
+
|
|
11
|
+
# 全局安装
|
|
12
|
+
npm i -g @gbits-jszx/dg-cli
|
|
13
|
+
dg-cli doctor
|
|
14
|
+
|
|
15
|
+
# 项目本地依赖
|
|
16
|
+
npm i -D @gbits-jszx/dg-cli
|
|
17
|
+
npx dg-cli doctor
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 平台支持
|
|
21
|
+
|
|
22
|
+
| OS | Arch |
|
|
23
|
+
|---|---|
|
|
24
|
+
| Linux | x64 / arm64 |
|
|
25
|
+
| macOS | Intel / Apple Silicon |
|
|
26
|
+
| Windows | x64 |
|
|
27
|
+
|
|
28
|
+
> npm 装包时根据 `process.platform/arch` 自动只下载当前平台的二进制(约 15MB),其它子包跳过。
|
|
29
|
+
|
|
30
|
+
## 主要命令
|
|
31
|
+
|
|
32
|
+
- `dg-cli doctor` — 环境自检
|
|
33
|
+
- `dg-cli config init|validate|path` — 配置文件管理(schema 驱动)
|
|
34
|
+
- `dg-cli helm install|uninstall` — Helm Chart 部署(K8s/K3s)
|
|
35
|
+
- `dg-cli image build|push` — 镜像构建发布
|
|
36
|
+
- `dg-cli system rotate-secret` — 业务系统密钥轮换
|
|
37
|
+
- `dg-cli release npm build|publish` — npm 包构建与发布
|
|
38
|
+
|
|
39
|
+
完整文档:[DataGateway 项目仓库](https://m68gitlab.g-bits.com/jszx-infra/datagateway)。
|
|
40
|
+
|
|
41
|
+
## 0.4.0 Breaking Changes
|
|
42
|
+
|
|
43
|
+
- `helm install --scope all/app` 不再接受空 tag 或可变别名(latest/main/master/stable/current),必须传入确定性 tag(如 git SHA)。违反时 Exit 3。
|
|
44
|
+
- npx 入口启动时异步检测 dist-tags,旧版本会打印升级提示(可设 `DG_NPX_NO_VERSION_CHECK=1` 禁用)。
|
|
45
|
+
|
|
46
|
+
## 常见问题
|
|
47
|
+
|
|
48
|
+
**Q1:装完执行报「不支持的平台」**
|
|
49
|
+
当前平台未被收录。请联系维护者补齐子包,或通过仓库内 GitLab 渠道安装本地构建版本。
|
|
50
|
+
|
|
51
|
+
**Q2:`npx` 报错「需要登录 https://registry.npmjs.org」**
|
|
52
|
+
本机 `~/.npmrc` 把 registry 切到了私有镜像。临时切回:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npm config set registry https://registry.npmjs.org/
|
|
56
|
+
npx -y --prefer-online @gbits-jszx/dg-cli@latest doctor
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Q3:helm install 报 Exit 3**
|
|
60
|
+
说明 `--tag` 为空或传入了可变别名。正确做法:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
IMG_TAG=$(git rev-parse --short HEAD)
|
|
64
|
+
npx -y --prefer-online @gbits-jszx/dg-cli@latest helm install --scope app --tag $IMG_TAG
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Q4:与 `configs/config.yaml`、`.env` 文件的优先级**
|
|
68
|
+
CLI flag > env (`DG_*`) > `configs/config.yaml` > 默认值。
|
|
69
|
+
|
|
70
|
+
## License
|
|
71
|
+
|
|
72
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gbits-jszx/dg-cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "DataGateway CLI — 部署/运维/配置一站式(Go binary,npx 分发)",
|
|
5
5
|
"bin": {
|
|
6
6
|
"dg-cli": "bin/dg-cli.js"
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"node": ">=14"
|
|
14
14
|
},
|
|
15
15
|
"optionalDependencies": {
|
|
16
|
-
"@gbits-jszx/dg-cli-linux-x64": "0.4.
|
|
17
|
-
"@gbits-jszx/dg-cli-linux-arm64": "0.4.
|
|
18
|
-
"@gbits-jszx/dg-cli-darwin-x64": "0.4.
|
|
19
|
-
"@gbits-jszx/dg-cli-darwin-arm64": "0.4.
|
|
20
|
-
"@gbits-jszx/dg-cli-win32-x64": "0.4.
|
|
16
|
+
"@gbits-jszx/dg-cli-linux-x64": "0.4.1",
|
|
17
|
+
"@gbits-jszx/dg-cli-linux-arm64": "0.4.1",
|
|
18
|
+
"@gbits-jszx/dg-cli-darwin-x64": "0.4.1",
|
|
19
|
+
"@gbits-jszx/dg-cli-darwin-arm64": "0.4.1",
|
|
20
|
+
"@gbits-jszx/dg-cli-win32-x64": "0.4.1"
|
|
21
21
|
},
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"repository": {
|