概述
用于管理飞书低代码平台线上构建任务的一系列指令。Kunlun 低代码开发过程中存在两种类型的构建场景:
- 使用 kldx dev 时,执行本地构建;
- 使用 kldx source push 时,执行云端构建。
执行 kldx source push 命令后,Kunlun 云端会自动调用打包工具将用户推送上来的代码构建为可供运行环境(浏览器、小程序)直接执行的产物形态。
开发者可通过 kldx build 命令管理这些云端构建任务。
kldx build list --tenant [tenantName] --limit [limitLength]
kldx build status [build_task_id] --tenant [tenantName]
kldx build cancel [build_task_id] --tenant [tenantName]
kldx build list
查询当前用户所有构建任务列表。
Usage: kldx build list [options]
query latest build tasks as list
Options:
--tenant <tenant> the target tenant name
--limit <limit> max list length, less than 50 (default: "20")
-h, --help display help for command
参数:
kldx build list
Build task list
┌───────────┬─────┬────────────────────────────────────────────────────┐
│ ID │ Status │ Message │
│ 1745191537292403 │ 10 │ package upload to tos success │
│ 1744662942519332 │ 90 │ [DX_BS_41002]: invalid dx-sdk in package.json │
│ 1744636831717480 │ 50 │ success │
│ 1744634281305117 │ 50 │ success │
│ 1744635394641947 │ 50 │ success │
│ 1744634281302039 │ 50 │ success │
│ 1744633043893284 │ 50 │ success │
│ 1744631743026232 │ 50 │ success │
│ 1744629794830376 │ 50 │ success │
│ 1744563286270983 │ 50 │ success │
│ 1744561404729358 │ 50 │ success │
│ 1744562069543955 │ 50 │ success │
│ 1744560748807179 │ 50 │ success │
│ 1744563285442631 │ 90 │ [DX_BS_41003]: ERROR in ../tmp/dx/1744563285442631 │
│ │ │ /4347920e-653f-4fc6-b73f-2e1dcb96b18b/source/compo │
│ │ │ nents/Parent1/index.tsx 1:0-29 │
│ │ │ Module not found: Error: Can't resolve 'antd' in ' │
│ │ │ /tmp/dx/1744563285442631/4347920e-653f-4fc6-b73f-2 │
│ │ │ e1dcb96b18b/source/components/Parent1' │
│ │ │ @ ../tmp/dx/1744563285442631/4347920e-653f-4fc6-b │
│ │ │ 73f-2e1dcb96b18b/source/components/__virtual/web-e │
│ │ │ ntry.ts 38:32-148 40:96-212 │
│ │ │ webpack compiled with 1 errors │
│ 1744549958498323 │ 50 │ success │
│ 1744549872058372 │ 50 │ success │
│ 1744548723169331 │ 50 │ success │
│ 1744484303827976 │ 50 │ success │
│ 1744484719393838 │ 50 │ success │
│ 1744478144460859 │ 50 │ success │
└───────────┴─────┴───────────────────────────────┘
命令结果包括:
- ID:构建任务的唯一标识
- Status:构建任务当前状态,枚举值:
- 10:构建中
- 50:构建成功
- 90:构建失败
- Message:构建结果描述,若构建出错,这里会包含详细的错误信息。
kldx build status
查询单个构建任务信息,其中 build_task_id 参数可通过上述 kldx build list 获取。
sage: kldx build status [options] [build_task_id]
query status of one build task
Arguments:
build_task_id build task id
Options:
--tenant <tenant> the target tenant name
-h, --help display help for command
参数:
示例:
kldx build status
Latest build status
┌───────────┬─────┬─────┐
│ ID │ Status │ Message │
│ 1745192203203604 │ 50 │ success │
└───────────┴─────┴─────┘
kldx build cancel
终止某条正在运行的构建任务。
若执行 kldx source push 后长时间未响应,有可能是因为线上已经有若干正在构建的任务阻塞了命令,可尝试使用 kldx build cancel 命令取消线上任务。
Usage: kldx build cancel [options] <build_task_id>
cancel one build task
Arguments:
build_task_id build task id
Options:
--tenant <tenant> the target tenant name
-h, --help display help for command
参数:
示例:
kldx build status
[ kldx ] Cancel build task success