From e6a5b8168c51e46fefffff03572abafe9f8b52dc Mon Sep 17 00:00:00 2001 From: Gitouche <26656-gitouche@users.noreply.framagit.org> Date: Fri, 12 Aug 2022 20:24:33 +0200 Subject: [PATCH] peerjs : use gitea as container repo (9) --- functions.sh | 8 ++++++++ podman-peerjs/ci_build-images.sh | 5 +---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/functions.sh b/functions.sh index 6e87e8e..406f209 100644 --- a/functions.sh +++ b/functions.sh @@ -305,3 +305,11 @@ else: sys.stderr.write('Invalid hash\n') sys.exit(-1)" | elfexec "${@}" } + +oci_push_to_registry () { + if ! skopeo inspect --format "Image ${upstream_images}:${version} found on remote container repository." docker://${upstream_images}:${version}; then + podman login --username ${CONTAINER_REPO_USER} --password ${CONTAINER_REPO_PASSWORD} ${upstream_images%%/*} && + # Try x times because of unexplained error 500 + for i in $(seq 1 3); do podman push ${upstream_images}:${version} && s=0 && break || s=$? && sleep 1; done; (exit $s) + fi +} diff --git a/podman-peerjs/ci_build-images.sh b/podman-peerjs/ci_build-images.sh index 3e96d07..52039a3 100755 --- a/podman-peerjs/ci_build-images.sh +++ b/podman-peerjs/ci_build-images.sh @@ -20,7 +20,4 @@ else echo "Image ${upstream_images}:${version} already built" fi && -if ! skopeo inspect --format "Image ${upstream_images}:${version} found on remote container repository." docker://${upstream_images}:${version}; then - podman login --username ${CONTAINER_REPO_USER} --password ${CONTAINER_REPO_PASSWORD} ${upstream_images%%/*} && - for i in $(seq 1 3); do podman push ${upstream_images}:${version} && s=0 && break || s=$? && sleep 1; done; (exit $s) -fi +oci_push_to_registry ${upstream_images}:${version}