Update Sync (#36765)

This commit is contained in:
Shiming Zhang
2024-12-20 13:51:45 +08:00
committed by GitHub
parent 89369a6deb
commit e7678e9589
5 changed files with 41 additions and 90 deletions

View File

@@ -1,4 +1,6 @@
name: Target Sync Image (old)
run-name: Target ${{ github.event.issue.title }} by @${{ github.actor }}
on:
issues:
types:
@@ -50,18 +52,14 @@ jobs:
- name: Set up crproxy
run: |
wget https://github.com/DaoCloud/crproxy/releases/download/v0.8.0/crproxy_linux_amd64 -O /usr/local/bin/crproxy && chmod +x /usr/local/bin/crproxy
/usr/local/bin/crproxy -a :8000 ${{ secrets.CRPROXY_ARGS }} &
wget https://github.com/DaoCloud/crproxy/releases/download/v0.13.0-alpha.43/crproxy_linux_amd64 -O /usr/local/bin/crproxy && chmod +x /usr/local/bin/crproxy
- name: Sync Images
- name: Sync Images to OSS&OBS
env:
MESSAGE: "${{ github.event.issue.body }}"
run: |
ORIGIN_IMAGE=$(echo "${MESSAGE}" | grep SYNC | awk '{print $2}' | head -n 1 | sed "s/\r//g")
curl --fail -X PUT "http://127.0.0.1:8000/internal/api/image/sync?image=${ORIGIN_IMAGE}"
gh issue comment ${{ github.event.issue.number }} -b "镜像 ${ORIGIN_IMAGE} 同步完成<br>请使用 m.daocloud.io/${ORIGIN_IMAGE} 替代源镜像"
gh issue edit ${{ github.event.issue.number }} --add-label "sync image succeeded" -b "IMAGE SYNC"
gh issue close ${{ github.event.issue.number }} --reason "completed"
/usr/local/bin/crproxy sync --deep --max-warn 1 ${{ secrets.STORAGE_ARGS }} --user '${{ secrets.OCI_USER }}' --list ${ORIGIN_IMAGE}
- name: Fail Sync
if: failure()