From 4d119bdf5677206888ad3828ca79f5404f1eb13b Mon Sep 17 00:00:00 2001 From: xiongxiao Date: Mon, 12 Jan 2026 14:16:22 +0800 Subject: [PATCH] update --- .cnb.yml | 42 ++++++++++++++++-------------------------- .cnb/template.yml | 12 ++++++------ 2 files changed, 22 insertions(+), 32 deletions(-) diff --git a/.cnb.yml b/.cnb.yml index e88aa06..5f4cee3 100644 --- a/.cnb.yml +++ b/.cnb.yml @@ -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 \ No newline at end of file diff --git a/.cnb/template.yml b/.cnb/template.yml index d8444d9..204782b 100644 --- a/.cnb/template.yml +++ b/.cnb/template.yml @@ -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