peerjs : use gitea as container repo (9)

This commit is contained in:
Gitouche 2022-08-12 20:24:33 +02:00
parent 5032a1e0c2
commit e6a5b8168c
2 changed files with 9 additions and 4 deletions

View file

@ -305,3 +305,11 @@ else:
sys.stderr.write('Invalid hash\n') sys.stderr.write('Invalid hash\n')
sys.exit(-1)" | elfexec "${@}" 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
}

View file

@ -20,7 +20,4 @@ else
echo "Image ${upstream_images}:${version} already built" echo "Image ${upstream_images}:${version} already built"
fi && fi &&
if ! skopeo inspect --format "Image ${upstream_images}:${version} found on remote container repository." docker://${upstream_images}:${version}; then oci_push_to_registry ${upstream_images}:${version}
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