Compare commits

..

2 Commits

Author SHA1 Message Date
F嘉阳
36aa47fc3d bladex_to_gitea 2025-11-25 22:48:32 +08:00
F嘉阳
17ab86648a bladex_to_gitea 2025-11-24 20:57:07 +08:00
5 changed files with 49 additions and 21 deletions

View File

@@ -1,19 +1,19 @@
name: 阿里云仓库同步流水线 name: 仓库同步流水线
on: on:
push: push:
branches: branches:
- master - master
paths: paths:
- 'aliyun_repos.yaml' - 'bladex_to_gitea.yaml'
- '.gitea/workflows/aliyun-repo-sync.yml' - '.gitea/workflows/bladex_to_gitea_pipeline.yml'
workflow_dispatch: workflow_dispatch:
schedule: schedule:
# 每凌晨2点执行 # 每凌晨1点执行
- cron: '0 2 * * 0' - cron: '0 1 * * 0'
env: env:
CONFIG_FILE: 'aliyun_repos.yaml' CONFIG_FILE: 'bladex_to_gitea.yaml'
jobs: jobs:
sync-repositories: sync-repositories:
@@ -68,7 +68,7 @@ jobs:
echo "" echo ""
echo "[3] 检查是否可以访问上游仓库(匿名测试):" echo "[3] 检查是否可以访问上游仓库(匿名测试):"
if command -v git >/dev/null 2>&1; then if command -v git >/dev/null 2>&1; then
timeout 30 git ls-remote https://center.javablade.com/blade/aliyun-Tool.git HEAD || echo "❌ 无法访问仓库" timeout 30 git ls-remote https://center.javablade.com/blade/BladeX-Tool.git HEAD || echo "❌ 无法访问仓库"
else else
echo "⚠️ git 命令不可用" echo "⚠️ git 命令不可用"
fi fi
@@ -77,8 +77,8 @@ jobs:
- name: 从配置文件中提取仓库并同步 - name: 从配置文件中提取仓库并同步
env: env:
UPSTREAM_USERNAME: ${{ secrets.UPSTREAM_USERNAME }} UPSTREAM_USERNAME: ${{ secrets.ALIYUN_UPSTREAM_USERNAME }}
UPSTREAM_TOKEN: ${{ secrets.UPSTREAM_TOKEN }} UPSTREAM_TOKEN: ${{ secrets.ALIYUN_UPSTREAM_TOKEN }}
TARGET_USERNAME: ${{ secrets.TARGET_USERNAME }} TARGET_USERNAME: ${{ secrets.TARGET_USERNAME }}
TARGET_TOKEN: ${{ secrets.TARGET_TOKEN }} TARGET_TOKEN: ${{ secrets.TARGET_TOKEN }}
run: python3 sync_repos.py run: python3 sync_repos.py

View File

@@ -1,19 +1,19 @@
name: BladeX仓库同步流水线 name: 仓库同步流水线
on: on:
push: push:
branches: branches:
- master - master
paths: paths:
- 'bladex_repos.yaml' - 'bladex_to_gitea.yaml'
- '.gitea/workflows/bladex-repo-sync.yml' - '.gitea/workflows/bladex_to_gitea_pipeline.yml'
workflow_dispatch: workflow_dispatch:
schedule: schedule:
# 每凌晨1点执行 # 每凌晨1点执行
- cron: '0 1 * * 0' - cron: '0 1 * * 0'
env: env:
CONFIG_FILE: 'bladex_repos.yaml' CONFIG_FILE: 'bladex_to_gitea.yaml'
jobs: jobs:
sync-repositories: sync-repositories:

View File

@@ -1,7 +0,0 @@
# 多仓库同步配置文件
# 定义需要同步的仓库对,源仓库 -> 目标仓库
repositories:
- name: "pve-k3s-gitops"
source_url: "https://${CODEUP_USERNAME}:${CODEUP_PASSWORD}@codeup.aliyun.com/619ddf2bcfe94d7ade4c41ab/fjy8018/pve-k3s-gitops.git"
target_url: "https://${TARGET_USERNAME}:${TARGET_TOKEN}@gitea.fjy8018.top/fjy8018/pve-k3s-gitops.git"
branch: "master"

35
bladex_to_gitea.yaml Normal file
View File

@@ -0,0 +1,35 @@
# 多仓库同步配置文件
# 定义需要同步的仓库对,源仓库 -> 目标仓库
repositories:
- name: "bladex-tool"
source_url: "https://${UPSTREAM_USERNAME}:${UPSTREAM_TOKEN}@center.javablade.com/blade/BladeX-Tool.git"
target_url: "https://${TARGET_USERNAME}:${TARGET_TOKEN}@gitea.fjy8018.top/BladeX/BladeX-Tool.git"
branch: "master"
- name: "BladeX-Safety"
source_url: "https://${UPSTREAM_USERNAME}:${UPSTREAM_TOKEN}@center.javablade.com/blade/BladeX-Safety.git"
target_url: "https://${TARGET_USERNAME}:${TARGET_TOKEN}@gitea.fjy8018.top/BladeX/BladeX-Safety.git"
branch: "master"
- name: "bladex"
source_url: "https://${UPSTREAM_USERNAME}:${UPSTREAM_TOKEN}@center.javablade.com/blade/BladeX.git"
target_url: "https://${TARGET_USERNAME}:${TARGET_TOKEN}@gitea.fjy8018.top/BladeX/BladeX.git"
branch: "master"
- name: "BladeX-Doc"
source_url: "https://${UPSTREAM_USERNAME}:${UPSTREAM_TOKEN}@center.javablade.com/blade/BladeX-Doc.git"
target_url: "https://${TARGET_USERNAME}:${TARGET_TOKEN}@gitea.fjy8018.top/BladeX/BladeX-Doc.git"
branch: "master"
- name: "BladeX-Boot"
source_url: "https://${UPSTREAM_USERNAME}:${UPSTREAM_TOKEN}@center.javablade.com/blade/BladeX-Boot.git"
target_url: "https://${TARGET_USERNAME}:${TARGET_TOKEN}@gitea.fjy8018.top/BladeX/BladeX-Boot.git"
branch: "master"
- name: "Saber"
source_url: "https://${UPSTREAM_USERNAME}:${UPSTREAM_TOKEN}@center.javablade.com/blade/Saber.git"
target_url: "https://${TARGET_USERNAME}:${TARGET_TOKEN}@gitea.fjy8018.top/BladeX/Saber.git"
branch: "master"
- name: "BladeX-Biz"
source_url: "https://${UPSTREAM_USERNAME}:${UPSTREAM_TOKEN}@center.javablade.com/blade/BladeX-Biz.git"
target_url: "https://${TARGET_USERNAME}:${TARGET_TOKEN}@gitea.fjy8018.top/BladeX/BladeX-Biz.git"
branch: "master"
- name: "Saber3"
source_url: "https://${UPSTREAM_USERNAME}:${UPSTREAM_TOKEN}@center.javablade.com/blade/Saber3.git"
target_url: "https://${TARGET_USERNAME}:${TARGET_TOKEN}@gitea.fjy8018.top/BladeX/Saber3.git"
branch: "master"