Add more error handling
This commit is contained in:
parent
e51a145cca
commit
5238124f3b
@ -59,11 +59,12 @@ _mkdir "${DISTFILES}"
|
|||||||
_mkdir "${BINPKG}"
|
_mkdir "${BINPKG}"
|
||||||
_mkdir "${LOGDIR}"
|
_mkdir "${LOGDIR}"
|
||||||
|
|
||||||
podman pull gentoo/stage3:amd64-nomultilib-systemd
|
podman pull gentoo/stage3:amd64-nomultilib-systemd || exit_err "Could not fetch the image."
|
||||||
podman build "${PODMAN_BUILD_ARGS[@]}"
|
podman build "${PODMAN_BUILD_ARGS[@]}" || exit_err "Build failed."
|
||||||
|
|
||||||
# Update the tag 'latest'.
|
# Update the tag 'latest'.
|
||||||
podman tag rm "${REGISTRY}:latest"
|
podman tag rm "${REGISTRY}:latest" # Do not exit_err here. At least on first run
|
||||||
podman tag "${REGISTRY}:${VERSION}" "${REGISTRY}:latest"
|
# there is no latest tag to delete.
|
||||||
|
podman tag "${REGISTRY}:${VERSION}" "${REGISTRY}:latest" || exit_err "Could not tag new image as 'latest'."
|
||||||
|
|
||||||
# vim:fileencoding=utf-8:ts=4:syntax=bash:expandtab
|
# vim:fileencoding=utf-8:ts=4:syntax=bash:expandtab
|
||||||
|
@ -58,8 +58,9 @@ _mkdir "${LOGDIR}"
|
|||||||
podman run "${PODMAN_BUILD_ARGS[@]}" "${REGISTRY}:${VERSION}" \
|
podman run "${PODMAN_BUILD_ARGS[@]}" "${REGISTRY}:${VERSION}" \
|
||||||
bash -c "emerge --usepkg --newuse --keep-going --oneshot --deep --update @world \
|
bash -c "emerge --usepkg --newuse --keep-going --oneshot --deep --update @world \
|
||||||
&& emerge @golang-rebuild @rust-rebuild \
|
&& emerge @golang-rebuild @rust-rebuild \
|
||||||
&& eclean-pkg --deep"
|
&& eclean-pkg --deep" \
|
||||||
|
|| exit_err "Could not build packages."
|
||||||
|
|
||||||
podman unshare chown -R "0:0" "${LOGDIR}"
|
podman unshare chown -R "0:0" "${LOGDIR}" || exit_err "Could not fix access right post build."
|
||||||
|
|
||||||
# vim:fileencoding=utf-8:ts=4:syntax=bash:expandtab
|
# vim:fileencoding=utf-8:ts=4:syntax=bash:expandtab
|
||||||
|
Reference in New Issue
Block a user