Compare commits
2 Commits
develop
...
cbf2aa37fd
| Author | SHA1 | Date | |
|---|---|---|---|
| cbf2aa37fd | |||
| 166223ef3f |
@@ -1,19 +1,19 @@
|
||||
name: 多仓库同步流水线
|
||||
name: 阿里云仓库同步流水线
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'bladex_to_gitea.yaml'
|
||||
- '.gitea/workflows/bladex_to_gitea_pipeline.yml'
|
||||
- 'aliyun_repos.yaml'
|
||||
- '.gitea/workflows/aliyun-repo-sync.yml'
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# 每周凌晨1点执行
|
||||
- cron: '0 1 * * 0'
|
||||
# 每天凌晨2点执行
|
||||
- cron: '0 2 * * 0'
|
||||
|
||||
env:
|
||||
CONFIG_FILE: 'bladex_to_gitea.yaml'
|
||||
CONFIG_FILE: 'aliyun_repos.yaml'
|
||||
|
||||
jobs:
|
||||
sync-repositories:
|
||||
@@ -68,7 +68,7 @@ jobs:
|
||||
echo ""
|
||||
echo "[3] 检查是否可以访问上游仓库(匿名测试):"
|
||||
if command -v git >/dev/null 2>&1; then
|
||||
timeout 30 git ls-remote https://center.javablade.com/blade/BladeX-Tool.git HEAD || echo "❌ 无法访问仓库"
|
||||
timeout 30 git ls-remote https://center.javablade.com/blade/aliyun-Tool.git HEAD || echo "❌ 无法访问仓库"
|
||||
else
|
||||
echo "⚠️ git 命令不可用"
|
||||
fi
|
||||
@@ -77,8 +77,8 @@ jobs:
|
||||
|
||||
- name: 从配置文件中提取仓库并同步
|
||||
env:
|
||||
UPSTREAM_USERNAME: ${{ secrets.ALIYUN_UPSTREAM_USERNAME }}
|
||||
UPSTREAM_TOKEN: ${{ secrets.ALIYUN_UPSTREAM_TOKEN }}
|
||||
UPSTREAM_USERNAME: ${{ secrets.UPSTREAM_USERNAME }}
|
||||
UPSTREAM_TOKEN: ${{ secrets.UPSTREAM_TOKEN }}
|
||||
TARGET_USERNAME: ${{ secrets.TARGET_USERNAME }}
|
||||
TARGET_TOKEN: ${{ secrets.TARGET_TOKEN }}
|
||||
run: python3 sync_repos.py
|
||||
@@ -1,19 +1,19 @@
|
||||
name: 多仓库同步流水线
|
||||
name: BladeX仓库同步流水线
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'bladex_to_gitea.yaml'
|
||||
- '.gitea/workflows/bladex_to_gitea_pipeline.yml'
|
||||
- 'bladex_repos.yaml'
|
||||
- '.gitea/workflows/bladex-repo-sync.yml'
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# 每周凌晨1点执行
|
||||
# 每天凌晨1点执行
|
||||
- cron: '0 1 * * 0'
|
||||
|
||||
env:
|
||||
CONFIG_FILE: 'bladex_to_gitea.yaml'
|
||||
CONFIG_FILE: 'bladex_repos.yaml'
|
||||
|
||||
jobs:
|
||||
sync-repositories:
|
||||
7
aliyun_repos.yaml
Normal file
7
aliyun_repos.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
# 多仓库同步配置文件
|
||||
# 定义需要同步的仓库对,源仓库 -> 目标仓库
|
||||
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"
|
||||
@@ -1,35 +0,0 @@
|
||||
# 多仓库同步配置文件
|
||||
# 定义需要同步的仓库对,源仓库 -> 目标仓库
|
||||
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"
|
||||
Reference in New Issue
Block a user