This commit is contained in:
2026-02-25 19:28:04 +08:00
parent 3ef9c47508
commit bbb762db97
9 changed files with 1 additions and 1 deletions

View File

@@ -0,0 +1,52 @@
export const myOrgs = ['kevisual', 'kevision', 'skillpod', 'zxj.im', 'abearxiong']
import dayjs from 'dayjs'
export const createBuildConfig = (params: { repo: string }) => {
const toRepo = params.repo!;
return `
# .cnb.yml
include:
- https://cnb.cool/kevisual/cnb/-/blob/main/.cnb/template.yml
.common_env: &common_env
env:
TO_REPO: ${toRepo}
TO_URL: git.xiongxiao.me
imports:
- https://cnb.cool/kevisual/env/-/blob/main/.env.development
.common_sync_to_gitea: &common_sync_to_gitea
- <<: *common_env
services: !reference [.common_sync_to_gitea_template, services]
stages: !reference [.common_sync_to_gitea_template, stages]
.common_sync_from_gitea: &common_sync_from_gitea
- <<: *common_env
services: !reference [.common_sync_from_gitea_template, services]
stages: !reference [.common_sync_from_gitea_template, stages]
main:
api_trigger_sync_to_gitea:
- <<: *common_sync_to_gitea
api_trigger_sync_from_gitea:
- <<: *common_sync_from_gitea
`
};
export const createCommitBlankConfig = (params: { repo?: string, event: 'api_trigger_event' }) => {
const now = dayjs().format('YYYY-MM-DD HH:mm')
const event = params?.event || 'api_trigger_event'
return `main:
${event}:
-
services:
- docker
stages:
- name: 显示 git remote
script: git remote -v
- name: commit_blank
script: |
echo "这是一个空白提交 时间: ${now}"
git commit --allow-empty -m "up: ${now}"
git push
`
}