services-garbaye/podman-hedgedoc/ci_build-images.sh
2023-06-13 21:25:54 +02:00

26 lines
856 B
Bash
Executable file

#!/usr/bin/env bash
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
source ${ABSDIR}/../functions.sh
source ${ABSDIR}/vars.sh
ensure_pwd_is_scriptdir
ensure_not_root
buildfolder=/tmp/hedgedoc-$$
if ! podman image exists ${hedgedoc_image}:${hedgedoc_version}; then
mkdir ${buildfolder} &&
git clone --depth=1 https://github.com/hedgedoc/container ${buildfolder}/ && {
podman image build -t ${hedgedoc_image}:${hedgedoc_version} -f ${buildfolder}/alpine/Dockerfile ${buildfolder}/
}
rm -rf ${buildfolder}
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/node)
else
echo "Image ${hedgedoc_image}:${hedgedoc_version} already built"
fi
oci_push_to_registry ${hedgedoc_image}:${hedgedoc_version}