services-garbaye/podman-privatebin/ci_build_images.sh
2023-07-29 09:14:59 +02:00

22 lines
922 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
if ! podman image exists ${privatebin_image}:${privatebin_version}; then
if git clone -b ${privatebin_version} --depth=1 https://github.com/PrivateBin/docker-nginx-fpm-alpine ; then
sed -i "s#mv cfg lib tpl vendor /srv#mv cfg lib tpl vendor /srv \&\& sed -i \\'/Content-Security-Policy\\\|X-XSS-Protection\\\|X-Frame-Options\\\|X-Content-Type-Options/d\\' /srv/lib/Controller.php#" docker-nginx-fpm-alpine/Dockerfile &&
podman image build -t "${privatebin_image}":"${privatebin_version}" docker-nginx-fpm-alpine || retval=false
fi
rm -rf docker-nginx-fpm-alpine
eval "$retval"
else
echo "Image ${privatebin_image}:${privatebin_version} already built"
fi &&
oci_push_to_registry ${privatebin_image}:${privatebin_version}