feat: 添加云端构建功能,支持参数配置和环境变量

This commit is contained in:
2026-03-10 01:18:27 +08:00
parent 7d227d3913
commit d08345d81c
6 changed files with 281 additions and 22 deletions

View File

@@ -3,6 +3,7 @@ import { app, cnbManager, notCNBCheck } from '../../app.ts';
import z from 'zod';
import './skills.ts';
import './keep.ts';
import './build.ts';
// 启动工作空间
app.route({
@@ -67,7 +68,7 @@ app.route({
page: page ?? 1,
pageSize: pageSize ?? 100,
});
ctx.forward({ code: 200, message: 'success', data: res });
ctx.forward(res);
}).addTo(app);
// 获取工作空间详情
@@ -99,7 +100,7 @@ app.route({
ctx.throw(400, '缺少参数 sn');
}
const res = await cnb.workspace.getDetail(repo, sn);
ctx.forward({ code: 200, message: 'success', data: res });
ctx.forward(res);
}).addTo(app);
// 删除工作空间
@@ -161,7 +162,6 @@ app.route({
})
}
}).define(async (ctx) => {
if (notCNBCheck(ctx)) { return; }
const cnb = await cnbManager.getContext(ctx);
const pipelineId = ctx.query?.pipelineId;
const sn = ctx.query?.sn;
@@ -169,6 +169,7 @@ app.route({
ctx.throw(400, 'pipelineId 和 sn 必须提供其中一个');
}
const res = await cnb.workspace.stopWorkspace({ pipelineId, sn });
ctx.forward({ code: 200, message: 'success', data: res });
ctx.forward(res);
}).addTo(app);