diff --git a/functions.sh b/functions.sh index 31d0815..94b5dcd 100644 --- a/functions.sh +++ b/functions.sh @@ -308,10 +308,15 @@ else: oci_push_to_registry () { if ! skopeo inspect --format "Image ${1} found on remote container registry." docker://${1}; then - podman login --username ${CONTAINER_REPO_USER} --password ${CONTAINER_REPO_PASSWORD} ${1%%/*} && - # Try x times because of unexplained error 500 - for i in $(seq 1 3); do podman push ${1} && s=0 && break || s=$? && sleep 1; done; (exit $s) && - podman image rm ${1} && - podman pull ${1} + if podman image exists ${1}; then + podman login --username ${CONTAINER_REPO_USER} --password ${CONTAINER_REPO_PASSWORD} ${1%%/*} && + # Try x times because of unexplained error 500 + for i in $(seq 1 3); do podman push ${1} && s=0 && break || s=$? && sleep 1; done; (exit $s) && + podman image rm ${1} && + podman pull ${1} + then + echo "Error : image ${1} does not exists" + exit 1 + fi fi } diff --git a/podman-framadate/ci_build_images.sh b/podman-framadate/ci_build_images.sh index 8348475..2422eaf 100755 --- a/podman-framadate/ci_build_images.sh +++ b/podman-framadate/ci_build_images.sh @@ -8,7 +8,7 @@ ensure_pwd_is_scriptdir ensure_not_root if ! podman image exists ${framadate_image}:${framadate_version}; then - podman build -t "${framadate_image}":"${framadate_version}" --build-arg=version="${framadate_release}" --file ./docker/Dockerfile + podman build -t "${framadate_image}":"${framadate_version}" --build-arg=version="${framadate_release}" --file docker/Dockerfile else echo "Image ${framadate_image}:${framadate_version} already built" fi