diff --git a/.github/workflows/target-image-sync.yml b/.github/workflows/target-image-sync.yml
index dbfda35..361ff89 100644
--- a/.github/workflows/target-image-sync.yml
+++ b/.github/workflows/target-image-sync.yml
@@ -50,11 +50,6 @@ jobs:
run: |
curl -v http://127.0.0.1:8080 || exit 1
curl -f --proxy 127.0.0.1:8080 -v http://m.daocloud.io/v2/ || exit 1
- - name: Override mirror.txt
- run: |
- IMAGE=$(echo "${{ github.event.issue.body }}" | grep SYNC | awk '{print $2}' | head -n 1)
- echo ${IMAGE} > mirror.txt
-
- name: Sync Images
env:
INCREMENTAL: "true"
@@ -62,10 +57,16 @@ jobs:
PARALLET: "1"
http_proxy: socks5://127.0.0.1:8080
https_proxy: socks5://127.0.0.1:8080
- run: |
- ./hack/diff.sh
- - name: Close Issue
run: |
IMAGE=$(echo "${{ github.event.issue.body }}" | grep SYNC | awk '{print $2}' | head -n 1)
- gh issue comment ${{ github.event.issue.number }} -b "镜像 ${IMAGE} 同步完成
请使用 m.daocloud.io/${IMAGE} 替代源镜像"
- gh issue close ${{ github.event.issue.number }} --reason "completed"
+ ./hack/diff-image.sh "${IMAGE}" "m.daocloud.io/${IMAGE}"
+ if [[ $? -ne 0 ]]; then
+ gh issue comment ${{ github.event.issue.number }} -b "镜像 ${IMAGE} 同步失败"
+ gh issue edit ${{ github.event.issue.number }} --title "FAILED SYNC IMAGE ${IMAGE}"
+ gh issue close ${{ github.event.issue.number }} --reason "not planned"
+ exit 1
+ else
+ IMAGE=$(echo "${{ github.event.issue.body }}" | grep SYNC | awk '{print $2}' | head -n 1)
+ gh issue comment ${{ github.event.issue.number }} -b "镜像 ${IMAGE} 同步完成
请使用 m.daocloud.io/${IMAGE} 替代源镜像"
+ gh issue close ${{ github.event.issue.number }} --reason "completed"
+ fi
diff --git a/hack/diff-image.sh b/hack/diff-image.sh
index 7b1b8c5..77659ef 100755
--- a/hack/diff-image.sh
+++ b/hack/diff-image.sh
@@ -254,7 +254,7 @@ function diff-image() {
increase=""
fi
- if [[ "${reduce}" != "" ]] || [[ "${increase}" != "" ]]; then
+ if [[ "${QUICKLY}" == "" ]] || [[ "${reduce}" != "" ]] || [[ "${increase}" != "" ]]; then
echo "${SELF}: NOT-SYNCHRONIZED-TAGS: ${image1} and ${image2} are not in synchronized" >&2
if [[ "${DEBUG}" == "true" ]]; then
echo "DEBUG: image1 ${image1}:" >&2