feat: 添加buildByConfig2方法以支持新的构建配置,并创建build-log.ts文件

This commit is contained in:
2026-02-25 15:50:05 +08:00
parent 43b61dc656
commit e6042e025f
2 changed files with 32 additions and 1 deletions

1
test/build-log.ts Normal file
View File

@@ -0,0 +1 @@
// 不用查看

View File

@@ -60,4 +60,34 @@ main:
api_trigger_sync_from_gitea:
- <<: *common_sync_from_gitea
`
buildByConfig()
// buildByConfig()
const buildByConfig2 = async () => {
const build = await repo.startBuild('kevisual/cnb', {
branch: 'main',
env: {
},
event: 'api_trigger_events',
config: config2,
});
console.log("build", showMore(build));
}
const config2 = `# .cnb.yml
include:
- https://cnb.cool/kevisual/cnb/-/blob/main/.cnb/template.yml
main:
api_trigger_events:
-
docker:
image: docker.cnb.cool/kevisual/dev-env:latest
services:
- vscode
- docker
stages:
- name: test
steps:
- run: echo "hello world"
`
buildByConfig2()