diff --git a/podman-framadate/ci_build_images.sh b/podman-framadate/ci_build_images.sh index 1d577ad..3d556cf 100755 --- a/podman-framadate/ci_build_images.sh +++ b/podman-framadate/ci_build_images.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash ABSDIR="$( dirname "$(readlink -f -- "$0")" )" -source ${ABSDIR}/../functions.sh -source ${ABSDIR}/vars.sh +source "${ABSDIR}"/../functions.sh +source "${ABSDIR}"/vars.sh ensure_pwd_is_scriptdir ensure_not_root diff --git a/podman-gitea/ci_build-images.sh b/podman-gitea/ci_build-images.sh index c2790f7..05dfc94 100755 --- a/podman-gitea/ci_build-images.sh +++ b/podman-gitea/ci_build-images.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash ABSDIR="$( dirname "$(readlink -f -- "$0")" )" -source ${ABSDIR}/../functions.sh -source ${ABSDIR}/vars.sh +source "${ABSDIR}"/../functions.sh +source "${ABSDIR}"/vars.sh ensure_pwd_is_scriptdir ensure_not_root @@ -11,18 +11,18 @@ buildfolder=/tmp/gitea-$$ if ! podman image exists ${gitea_image}:${gitea_version}; then mkdir ${buildfolder} && - git clone -b v${gitea_version} --depth=1 https://codeberg.org/forgejo/forgejo/ ${buildfolder} && { + if git clone -b v${gitea_version} --depth=1 https://codeberg.org/forgejo/forgejo/ ${buildfolder} ; then TMPDIR=${HOME} podman image build \ --label org.opencontainers.image.version="${gitea_version}" \ -t ${gitea_image}:${gitea_version} \ -f ${buildfolder}/Dockerfile ${buildfolder} || retval=false 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) - } + 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)" + fi rm -rf ${buildfolder} - eval $retval + eval "$retval" else echo "Image ${gitea_image}:${gitea_version} already built" fi && diff --git a/podman-hedgedoc/ci_build-images.sh b/podman-hedgedoc/ci_build-images.sh index 31bf0f7..9bf73ae 100755 --- a/podman-hedgedoc/ci_build-images.sh +++ b/podman-hedgedoc/ci_build-images.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash ABSDIR="$( dirname "$(readlink -f -- "$0")" )" -source ${ABSDIR}/../functions.sh -source ${ABSDIR}/vars.sh +source "${ABSDIR}"/../functions.sh +source "${ABSDIR}"/vars.sh ensure_pwd_is_scriptdir ensure_not_root @@ -11,14 +11,14 @@ buildfolder=/tmp/hedgedoc-$$ if ! podman image exists ${hedgedoc_image}:${hedgedoc_version}; then mkdir ${buildfolder} && - git clone --depth=1 https://github.com/hedgedoc/container ${buildfolder}/ && { + if git clone --depth=1 https://github.com/hedgedoc/container ${buildfolder}/ ; then podman image build -t ${hedgedoc_image}:${hedgedoc_version} -f ${buildfolder}/alpine/Dockerfile ${buildfolder}/ - } || retval=false + fi || retval=false 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) - eval $retval + podman image rm -f "$(podman image list -a -q -- docker.io/library/node)" + eval "$retval" else echo "Image ${hedgedoc_image}:${hedgedoc_version} already built" fi && diff --git a/podman-jitsi/ci_build-images.sh b/podman-jitsi/ci_build-images.sh index b7f569b..bdd2d01 100755 --- a/podman-jitsi/ci_build-images.sh +++ b/podman-jitsi/ci_build-images.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash ABSDIR="$( dirname "$(readlink -f -- "$0")" )" -source ${ABSDIR}/../functions.sh -source ${ABSDIR}/vars.sh +source "${ABSDIR}"/../functions.sh +source "${ABSDIR}"/vars.sh ensure_pwd_is_scriptdir ensure_not_root @@ -13,41 +13,42 @@ build_base() { podman image pull docker.io/library/debian:bullseye-slim if ! podman image exists localhost/jitsi/base:${version}; then podman image build -t localhost/jitsi/base:${version} ${buildfolder}/base/ && - podman image tag localhost/jitsi/base:${version} localhost/jitsi/base:latest || exit -1 + podman image tag localhost/jitsi/base:${version} localhost/jitsi/base:latest || exit 255 fi if ! podman image exists localhost/jitsi/base-java:${version}; then podman image build -t localhost/jitsi/base-java:${version} ${buildfolder}/base-java && - podman image tag localhost/jitsi/base-java:${version} localhost/jitsi/base-java:latest || exit -1 + podman image tag localhost/jitsi/base-java:${version} localhost/jitsi/base-java:latest || exit 255 fi base_cleanup=true } mkdir ${buildfolder} && -curl -sSfL -- "https://github.com/jitsi/docker-jitsi-meet/archive/refs/tags/${version}.tar.gz" | tar xz --strip-components 1 -C ${buildfolder}/ && { +if curl -sSfL -- "https://github.com/jitsi/docker-jitsi-meet/archive/refs/tags/${version}.tar.gz" | tar xz --strip-components 1 -C ${buildfolder}/ ; then if ! podman image exists git.garbaye.fr/garbaye/jitsi-jvb:${version}; then build_base - podman image build -t git.garbaye.fr/garbaye/jitsi-jvb:${version} ${buildfolder}/jvb/ || exit -1 + podman image build -t git.garbaye.fr/garbaye/jitsi-jvb:${version} ${buildfolder}/jvb/ || exit 255 fi if ! podman image exists git.garbaye.fr/garbaye/jitsi-jicofo:${version}; then build_base - podman image build -t git.garbaye.fr/garbaye/jitsi-jicofo:${version} ${buildfolder}/jicofo/ || exit -1 + podman image build -t git.garbaye.fr/garbaye/jitsi-jicofo:${version} ${buildfolder}/jicofo/ || exit 255 fi if ! podman image exists git.garbaye.fr/garbaye/jitsi-prosody:${version}; then build_base - podman image build -t git.garbaye.fr/garbaye/jitsi-prosody:${version} ${buildfolder}/prosody/ || exit -1 + podman image build -t git.garbaye.fr/garbaye/jitsi-prosody:${version} ${buildfolder}/prosody/ || exit 255 fi if ! podman image exists git.garbaye.fr/garbaye/jitsi-web:${version}; then build_base - podman image build -t git.garbaye.fr/garbaye/jitsi-web:${version} ${buildfolder}/web/ || exit -1 + podman image build -t git.garbaye.fr/garbaye/jitsi-web:${version} ${buildfolder}/web/ || exit 255 fi dangling_images=$(podman image list -f "dangling=true" -q) - [ ! -z "${dangling_images}" ] && podman image rm -f ${dangling_images} - if [ ! -z ${base_cleanup} ] ; then + [ -n "${dangling_images}" ] && podman image rm -f "${dangling_images}" + if [ -n "${base_cleanup}" ] ; then podman image rm localhost/jitsi/base-java:${version} localhost/jitsi/base-java:latest podman image rm localhost/jitsi/base:${version} localhost/jitsi/base:latest fi -} ; rm -rf ${buildfolder} +fi +rm -rf ${buildfolder} for image in ${upstream_images}; do - oci_push_to_registry ${image}:${version} + oci_push_to_registry "${image}":${version} done diff --git a/podman-ntfy/ci_build-images.sh b/podman-ntfy/ci_build-images.sh index f2d9244..20c6aa2 100755 --- a/podman-ntfy/ci_build-images.sh +++ b/podman-ntfy/ci_build-images.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash ABSDIR="$( dirname "$(readlink -f -- "$0")" )" -source ${ABSDIR}/../functions.sh -source ${ABSDIR}/vars.sh +source "${ABSDIR}"/../functions.sh +source "${ABSDIR}"/vars.sh ensure_pwd_is_scriptdir ensure_not_root @@ -11,8 +11,8 @@ if ! podman image exists ${ntfy_image}:${ntfy_version}; then TMPDIR=${HOME} podman image build -t "${ntfy_image}:${ntfy_version}" container/ --build-arg NTFY_VERSION=${ntfy_version} || exit 1 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) + 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)" else echo "Image ${ntfy_image}:${ntfy_version} already built" fi diff --git a/podman-peerjs/ci_build-images.sh b/podman-peerjs/ci_build-images.sh index 743f10f..2cb35c3 100755 --- a/podman-peerjs/ci_build-images.sh +++ b/podman-peerjs/ci_build-images.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash ABSDIR="$( dirname "$(readlink -f -- "$0")" )" -source ${ABSDIR}/../functions.sh -source ${ABSDIR}/vars.sh +source "${ABSDIR}"/../functions.sh +source "${ABSDIR}"/vars.sh ensure_pwd_is_scriptdir ensure_not_root @@ -18,9 +18,9 @@ if ! podman image exists ${upstream_images}:${version}; then --label org.opencontainers.image.title='PeerServer' \ --label org.opencontainers.image.url='https://peerjs.com' \ -t ${upstream_images}:${version} ${buildfolder}/ || retval=false - podman image rm -f $(podman image list -a -q -- docker.io/library/node) + podman image rm -f "$(podman image list -a -q -- docker.io/library/node)" rm -rf ${buildfolder} - eval $retval + eval "$retval" else echo "Image ${upstream_images}:${version} already built" fi && diff --git a/podman-privatebin/ci_build_images.sh b/podman-privatebin/ci_build_images.sh index e6cd4fe..6274d21 100755 --- a/podman-privatebin/ci_build_images.sh +++ b/podman-privatebin/ci_build_images.sh @@ -1,18 +1,19 @@ #!/usr/bin/env bash ABSDIR="$( dirname "$(readlink -f -- "$0")" )" -source ${ABSDIR}/../functions.sh -source ${ABSDIR}/vars.sh +source "${ABSDIR}"/../functions.sh +source "${ABSDIR}"/vars.sh ensure_pwd_is_scriptdir ensure_not_root if ! podman image exists ${privatebin_image}:${privatebin_version}; then - git clone -b ${privatebin_version} --depth=1 https://github.com/PrivateBin/docker-nginx-fpm-alpine && - 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 + 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 + eval "$retval" else echo "Image ${privatebin_image}:${privatebin_version} already built" fi && diff --git a/podman-seafile/ci_build-images.sh b/podman-seafile/ci_build-images.sh index 7aa53f8..9d1ccaf 100755 --- a/podman-seafile/ci_build-images.sh +++ b/podman-seafile/ci_build-images.sh @@ -9,17 +9,17 @@ ensure_not_root buildfolder=/tmp/seafile-$$ -if ! podman image exists "${seafile_image}":"${seafile_release}"; then +if ! podman image exists ${seafile_image}:${seafile_release}; then mkdir ${buildfolder} && if git clone --depth=1 https://github.com/haiwen/seafile-docker.git ${buildfolder}/ ; then - sed_in_place "^FROM phusion" "FROM docker.io/phusion" ${buildfolder}/image/seafile_"${seafile_release%.*}"/Dockerfile && - sed_in_place "SEAFILE_VERSION=" "SEAFILE_VERSION=${seafile_release}" ${buildfolder}/image/seafile_"${seafile_release%.*}"/Dockerfile && - sed_in_place "pip -i https://pypi.tuna.tsinghua.edu.cn/simple/" "pip" ${buildfolder}/image/seafile_"${seafile_release%.*}"/Dockerfile && - sed_in_place " -i https://pypi.tuna.tsinghua.edu.cn/simple/" " " ${buildfolder}/image/seafile_"${seafile_release%.*}"/Dockerfile && - sed_in_place 'wget https://seafile-downloads.oss-cn-shanghai.aliyuncs.com' 'wget -q https://download.seadrive.org' ${buildfolder}/image/seafile_"${seafile_release%.*}"/Dockerfile && - sed_in_place 'tar -zxvf' 'tar -zxf' ${buildfolder}/image/seafile_"${seafile_release%.*}"/Dockerfile && - podman image build -t "${seafile_image}":"${seafile_release}" \ - -f ${buildfolder}/image/seafile_"${seafile_release%.*}"/Dockerfile \ + sed_in_place "^FROM phusion" "FROM docker.io/phusion" ${buildfolder}/image/seafile_${seafile_release%.*}/Dockerfile && + sed_in_place "SEAFILE_VERSION=" "SEAFILE_VERSION=${seafile_release}" ${buildfolder}/image/seafile_${seafile_release%.*}/Dockerfile && + sed_in_place "pip -i https://pypi.tuna.tsinghua.edu.cn/simple/" "pip" ${buildfolder}/image/seafile_${seafile_release%.*}/Dockerfile && + sed_in_place " -i https://pypi.tuna.tsinghua.edu.cn/simple/" " " ${buildfolder}/image/seafile_${seafile_release%.*}/Dockerfile && + sed_in_place 'wget https://seafile-downloads.oss-cn-shanghai.aliyuncs.com' 'wget -q https://download.seadrive.org' ${buildfolder}/image/seafile_${seafile_release%.*}/Dockerfile && + sed_in_place 'tar -zxvf' 'tar -zxf' ${buildfolder}/image/seafile_${seafile_release%.*}/Dockerfile && + podman image build -t ${seafile_image}:${seafile_release} \ + -f ${buildfolder}/image/seafile_${seafile_release%.*}/Dockerfile \ ${buildfolder} || retval=false podman image rm -f "$(podman image list -a -q -- phusion/baseimage)" fi @@ -29,4 +29,4 @@ else echo "Image ${seafile_image}:${seafile_release} already built" fi && -oci_push_to_registry "${seafile_image}":"${seafile_release}" +oci_push_to_registry ${seafile_image}:${seafile_release} diff --git a/podman-vaultwarden/ci_build-images.sh b/podman-vaultwarden/ci_build-images.sh index fed66ec..aea59db 100755 --- a/podman-vaultwarden/ci_build-images.sh +++ b/podman-vaultwarden/ci_build-images.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash ABSDIR="$( dirname "$(readlink -f -- "$0")" )" -source ${ABSDIR}/../functions.sh -source ${ABSDIR}/vars.sh +source "${ABSDIR}"/../functions.sh +source "${ABSDIR}"/vars.sh ensure_pwd_is_scriptdir ensure_not_root @@ -11,19 +11,19 @@ buildfolder=/tmp/vaultwarden-$$ if ! podman image exists ${vaultwarden_image}:${vaultwarden_version}; then mkdir ${buildfolder} && - git clone --depth=1 --branch=${vaultwarden_version} https://github.com/dani-garcia/vaultwarden.git ${buildfolder}/ && { - sed_in_place "^FROM vaultwarden/web-vault" "FROM docker.io/vaultwarden/web-vault" ${buildfolder}/docker/amd64/Dockerfile.alpine - sed_in_place "^FROM blackdex/rust-musl" "FROM docker.io/blackdex/rust-musl" ${buildfolder}/docker/amd64/Dockerfile.alpine - sed_in_place "^FROM alpine" "FROM docker.io/library/alpine" ${buildfolder}/docker/amd64/Dockerfile.alpine - TMPDIR=${HOME} podman image build -t ${vaultwarden_image}:${vaultwarden_version} -f ${buildfolder}/docker/amd64/Dockerfile.alpine ${buildfolder} - } || retval=false + if git clone --depth=1 --branch=${vaultwarden_version} https://github.com/dani-garcia/vaultwarden.git ${buildfolder}/ ; then + sed_in_place "^FROM vaultwarden/web-vault" "FROM docker.io/vaultwarden/web-vault" ${buildfolder}/docker/amd64/Dockerfile.alpine && + sed_in_place "^FROM blackdex/rust-musl" "FROM docker.io/blackdex/rust-musl" ${buildfolder}/docker/amd64/Dockerfile.alpine && + sed_in_place "^FROM alpine" "FROM docker.io/library/alpine" ${buildfolder}/docker/amd64/Dockerfile.alpine && + TMPDIR=${HOME} podman image build -t ${vaultwarden_image}:${vaultwarden_version} -f ${buildfolder}/docker/amd64/Dockerfile.alpine ${buildfolder} || retval=false + fi 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 -- vaultwarden/web-vault) - podman image rm -f $(podman image list -a -q -- docker.io/blackdex/rust-musl) - podman image rm -f $(podman image list -a -q -- dockerio/library/alpine) - eval $retval + podman image rm -f "$(podman image list -a -q -- vaultwarden/web-vault)" + podman image rm -f "$(podman image list -a -q -- docker.io/blackdex/rust-musl)" + podman image rm -f "$(podman image list -a -q -- dockerio/library/alpine)" + eval "$retval" else echo "Image ${vaultwarden_image}:${vaultwarden_version} already built" fi &&