feat: 添加buildByConfig2方法以支持新的构建配置,并创建build-log.ts文件
This commit is contained in:
1
test/build-log.ts
Normal file
1
test/build-log.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
// 不用查看
|
||||||
@@ -60,4 +60,34 @@ main:
|
|||||||
api_trigger_sync_from_gitea:
|
api_trigger_sync_from_gitea:
|
||||||
- <<: *common_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()
|
||||||
Reference in New Issue
Block a user