1
0

ci: registry sync
Some checks failed
ci/woodpecker/push/build Pipeline failed
ci/woodpecker/manual/build Pipeline failed

This commit is contained in:
Konstantin Demin 2024-05-28 11:44:34 +03:00
parent 4738f919a2
commit cd812fe4ee
Signed by: krd
GPG Key ID: 4D56F87A8BA65FD0
2 changed files with 18 additions and 37 deletions

View File

@ -10,8 +10,25 @@ set -ef
. .ci/envsh.common
. .ci/envsh.registry
r=0
image_src="docker://${IMAGE_NAME}"
image_dst="docker://${EXT_IMAGE_NAME}"
oci_dir="$PWD/oci-layers"
image_interim="oci:${oci_dir}:$(basename "${IMAGE_NAME}")"
for tag in ${IMAGE_TAG} ${EXTRA_TAGS} ; do
[ -n "${tag}" ] || continue
skopeo copy --all "docker://${IMAGE_NAME}:${tag}" "docker://${EXT_IMAGE_NAME}:${tag}"
rm -rf "${oci_dir}" ; mkdir "${oci_dir}"
skopeo copy --all "${image_src}:${tag}" "${image_interim}:${tag}" || r=$?
[ "$r" = 0 ] || break
skopeo copy --all "${image_interim}:${tag}" "${image_dst}:${tag}" || r=$?
[ "$r" = 0 ] || break
done
rm -rf "${oci_dir}"
exit "$r"

View File

@ -1,36 +0,0 @@
when:
- event: [ manual ]
evaluate: 'CI_DEBUG == "sync"'
variables:
- &image_name 'quay.krd.sh/krd/woodpecker-sonatype-nexus'
- &ext_image_name 'docker.io/rockdrilla/woodpecker-sonatype-nexus'
- &skopeo_image 'quay.krd.sh/quay_io/containers/skopeo:v1.15.0'
## kind of fixup (remove in near future)
## ref: https://github.com/woodpecker-ci/plugin-git/releases
clone:
git:
image: quay.krd.sh/docker_io/woodpeckerci/plugin-git:2.5.0
## NB: ${variable} expressions are subject to pre-processing.
## ref: https://woodpecker-ci.org/docs/usage/environment
steps:
- name: image-sync
image: *skopeo_image
environment:
GOMAXPROCS: "4"
MALLOC_ARENA_MAX: "4"
##
IMAGE_NAME: *image_name
EXT_IMAGE_NAME: *ext_image_name
secrets: [ REGISTRY_AUTH ]
commands:
- .ci/registry-login.sh quay.krd.sh docker.io
- .ci/sync-all.sh
## personal tweaks :)
labels:
network: dmz