This commit is contained in:
xiongxiao
2026-01-12 14:16:22 +08:00
parent 64f24910cb
commit 4d119bdf56
2 changed files with 22 additions and 32 deletions

View File

@@ -1,6 +1,7 @@
# .cnb.yml
include:
- https://cnb.cool/kevisual/cnb/-/blob/main/.cnb/template.yml
.common_env: &common_env
env:
TO_REPO: kevisual/cnb
@@ -18,35 +19,24 @@ $:
# - name: pnpm install
# script: pnpm install
.common_sync_to_gitea: &common_sync_to_gitea
- <<: *common_env
services: !reference [.common_sync_to_gitea_template, services]
imports: !reference [.common_sync_to_gitea_template, imports]
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]
imports: !reference [.common_sync_from_gitea_template, imports]
stages: !reference [.common_sync_from_gitea_template, stages]
main:
web_trigger_sync_to_gitea:
env: !reference [.common_env, env]
services: !reference [.common_sync_to_gitea, services]
imports: !reference [.common_sync_to_gitea, imports]
stages: !reference [.common_sync_to_gitea, stages]
- <<: *common_sync_to_gitea
web_trigger_sync_from_gitea:
- <<: *common_env
stages:
- name: "测试变量"
script: |
echo "TO_REPO: ${TO_REPO}"
echo "TO_URL: ${TO_URL}"
echo '从gitea同步'
- <<: *common_sync_from_gitea
api_trigger_sync_to_gitea:
- <<: *common_env
stages:
- name: "测试变量"
script: |
echo "TO_REPO: ${TO_REPO}"
echo "TO_URL: ${TO_URL}"
echo '同步到gitea'
- <<: *common_sync_to_gitea
api_trigger_sync_from_gitea:
- <<: *common_env
stages:
- name: "测试变量"
script: |
echo "TO_REPO: ${TO_REPO}"
echo "TO_URL: ${TO_URL}"
echo '同步到gitea'
- <<: *common_sync_from_gitea

View File

@@ -1,4 +1,4 @@
.common_sync_to_gitea: &common_sync_to_gitea
.common_sync_to_gitea_template: &common_sync_to_gitea_template
services:
- docker
imports:
@@ -21,7 +21,7 @@
sync_mode: rebase
branch: main
.common_sync_from_gitea: &common_sync_from_gitea
.common_sync_from_gitea_template: &common_sync_from_gitea_template
services:
- docker
imports:
@@ -41,10 +41,10 @@
# main:
# web_trigger_sync_to_gitea:
# - <<: *common_sync_to_gitea
# - <<: *common_sync_to_gitea_template
# web_trigger_sync_from_gitea:
# - <<: *common_sync_from_gitea
# - <<: *common_sync_from_gitea_template
# api_trigger_sync_to_gitea:
# - <<: *common_sync_to_gitea
# - <<: *common_sync_to_gitea_template
# api_trigger_sync_from_gitea:
# - <<: *common_sync_from_gitea
# - <<: *common_sync_from_gitea_template