ci: registry sync
This commit is contained in:
parent
4738f919a2
commit
cd812fe4ee
|
@ -10,8 +10,25 @@ set -ef
|
||||||
. .ci/envsh.common
|
. .ci/envsh.common
|
||||||
. .ci/envsh.registry
|
. .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
|
for tag in ${IMAGE_TAG} ${EXTRA_TAGS} ; do
|
||||||
[ -n "${tag}" ] || continue
|
[ -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
|
done
|
||||||
|
|
||||||
|
rm -rf "${oci_dir}"
|
||||||
|
exit "$r"
|
||||||
|
|
|
@ -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
|
|
Loading…
Reference in New Issue
Block a user