services-garbaye/podman-ntfy/ci_build-images.sh

22 lines
781 B
Bash
Raw Normal View History

2022-11-15 18:16:59 +00:00
#!/usr/bin/env bash
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
2023-07-29 07:14:59 +00:00
source "${ABSDIR}"/../functions.sh
source "${ABSDIR}"/vars.sh
2022-11-15 18:16:59 +00:00
ensure_pwd_is_scriptdir
ensure_not_root
if ! podman image exists ${ntfy_image}:${ntfy_version}; then
2023-10-28 15:41:15 +00:00
TMPDIR=${HOME} podman image build -t "${ntfy_image}:${ntfy_version}" container/ --build-arg NTFY_VERSION=${ntfy_version} || retval=false
2022-11-15 18:16:59 +00:00
podman image prune -a -f --filter dangling=true
podman image prune -a -f --filter intermediate=true
podman image rm -f $(podman image list -a -q -- docker.io/library/golang)
podman image rm -f $(podman image list -a -q -- docker.io/library/alpine)
2023-10-28 15:41:15 +00:00
eval "$retval"
2022-11-15 18:16:59 +00:00
else
echo "Image ${ntfy_image}:${ntfy_version} already built"
2023-10-28 15:41:15 +00:00
fi &&
2022-11-15 18:16:59 +00:00
oci_push_to_registry ${ntfy_image}:${ntfy_version}