diff --git a/.github/workflows/syncer.sh b/.github/workflows/syncer.sh new file mode 100644 index 0000000..6bff18c --- /dev/null +++ b/.github/workflows/syncer.sh @@ -0,0 +1,118 @@ +#!/bin/bash +cur=$(cd "$(dirname "$0")"; pwd) +cd $cur +set +e +# dash>> 本操作从1970年01月01日00:00:00 开始 , 到2024年09月10日01:54:39 结束, 共历时1725933279秒 +# rm -f /bin/sh; ln -s /bin/bash /bin/sh #deb,ubt; >>>>送错参 +source ../../compile/src/common.sh #print_time_cost + +# ref quickstart-imgdeploy//imgpackage/2syncer.sh +# https://github.com/AliyunContainerService/image-syncer/releases/download/v1.5.5/image-syncer-v1.5.5-linux-amd64.tar.gz +# https://github.com/AliyunContainerService/image-syncer/releases/download/v1.5.5/image-syncer-v1.5.5-linux-arm64.tar.gz +function loadBins(){ + file=image-syncer-v1.5.5-linux-amd64.tar.gz; URL=https://github.com/AliyunContainerService/image-syncer/releases/download/v1.5.5/$file + curl -O -k -fSL $URL; + # view + echo "cur: $cur"; pwd; + ls -lh + + tar -zxf $file #-C ./ #$cur/ + ls -lh +} +loadBins + +mkdir -p conf +function authConf(){ + cat > conf/auth.yaml< conf/images.yaml<$dst]" $begin_time >> /tmp/.timecost #tee -a +} + +# REPO1=registry-1.docker.io +# REPO1=registry.cn-shenzhen.aliyuncs.com +# REPO2=registry.cn-shenzhen.aliyuncs.com #127.0.0.1:5000 +# REPO2=ccr.ccs.tencentyun.com +# REPO2=dockerhub.qingcloud.com +# +# REPO_HUB REPO_ALI REPO_TEN REPO_QING: from gitac.yml +test ! -z "$REPO_HUB" && doSync $REPO $REPO_HUB & +test ! -z "$REPO_ALI" && doSync $REPO $REPO_ALI & +test ! -z "$REPO_TEN" && doSync $REPO $REPO_TEN & +test ! -z "$REPO_QING" && doSync $REPO $REPO_QING & +wait + + +exit 0 +# vm-xx:/opt/apps/quickstart-imgdeploy/imgpackage/bin # ./image-syncer -h +# A Fast and Flexible docker registry image synchronization tool implement by Go. +# Complete documentation is available at https://github.com/AliyunContainerService/image-syncer +# Usage: +# image-syncer [flags] +# Aliases: +# image-syncer, image-syncer +# Flags: +# --arch stringArray architecture list to filter source tags, not works for OCI media +# --auth string auth file path. This flag need to be pair used with --images. +# --config string config file path. This flag is deprecated and will be removed in the future. Please use --auth and --images instead. +# --force force update manifest whether the destination manifest exists +# -h, --help help for image-syncer +# --images string images file path. This flag need to be pair used with --auth +# --log string log file path (default in os.Stderr) +# --os stringArray os list to filter source tags, not works for docker v2 schema1 and OCI media +# --output-images-format string success images output format, json or yaml (default "yaml") +# --output-success-images string output success images in a new file +# -p, --proc int numbers of working goroutines (default 5) +# -r, --retries int times to retry failed task (default 2)