add init tags

This commit is contained in:
2026-02-26 01:53:21 +08:00
parent 9e8c658159
commit 0d8d81b1fc
2 changed files with 8 additions and 6 deletions

View File

@@ -51,8 +51,9 @@ export const createCommitBlankConfig = (params: { repo?: string, event: 'api_tri
`
}
export const createDevConfig = (params: { repo?: string, event?: string }) => {
export const createDevConfig = (params: { repo?: string, event?: string, branch?: string }) => {
const event = params?.event || 'api_trigger_event';
const branch = params?.branch || 'main';
return `##### 配置开始,保留注释 #####
.common_env: &common_env
env:
@@ -64,12 +65,12 @@ export const createDevConfig = (params: { repo?: string, event?: string }) => {
# BAILIAN_CODE_API_KEY: '' # 阿里云百炼
# VOLCENGINE_API_KEY: '' # 火山引擎
# CNB_API_KEY: '' # CNB API
# CNB_COOKIE: '' # 可选配置用cnb.cool的cookie
# 可选应用配置
# FEISHU_APP_ID: '' # 飞书应用 ID
# FEISHU_APP_SECRET: '' # 飞书应用密钥
# CNB_COOKIE: '' # 可选配置用cnb.cool的cookie
USERNAME: root
ASSISTANT_CONFIG_DIR: /workspace/kevisual # ASSISTANT_CONFIG_DIR 环境变量指定了配置文件所在的目录
# CNB_KEVISUAL_ORG: kevisual # 私密仓库使用环境配置默认即可默认为当前用户组CNB_GROUP_SLUG
@@ -79,7 +80,7 @@ export const createDevConfig = (params: { repo?: string, event?: string }) => {
##### 配置结束 #####
main:
${branch}:
${event}:
- docker:
image: docker.cnb.cool/kevisual/dev-env:latest
@@ -88,6 +89,7 @@ main:
- docker
runner:
cpus: 16
#tags: cnb:arch:amd64:gpu
imports:
- https://cnb.cool/kevisual/env/-/blob/main/.env.development
env: !reference [.common_env, env]

View File

@@ -217,7 +217,7 @@ export const useRepoStore = create<State>((set, get) => {
repo: repo.path,
branch: 'main',
event: 'api_trigger_event',
config: createDevConfig({ repo: repo.path, event: 'api_trigger_event' }),
config: createDevConfig({ repo: repo.path, event: 'api_trigger_event', branch: 'main' }),
}
set({ buildConfig: config })
} catch (e) {