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

35 lines
1.5 KiB
Bash
Raw Normal View History

2022-11-26 22:00:34 +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-26 22:00:34 +00:00
ensure_pwd_is_scriptdir
ensure_not_root
buildfolder=/tmp/vaultwarden-$$
if ! podman image exists ${service_image}:${service_version}; then
2022-11-26 22:00:34 +00:00
mkdir ${buildfolder} &&
2024-02-16 20:10:07 +00:00
if git clone --depth=1 --branch=${service_version%%-*} https://github.com/dani-garcia/vaultwarden.git ${buildfolder}/ ; then
vaultwardenlangfrfolder=/tmp/vaultwardenlangfrfolder-$$
if git clone --depth=1 https://github.com/YoanSimco/vaultwarden-lang-fr.git ${vaultwardenlangfrfolder}/; then
install -v ${vaultwardenlangfrfolder}/email/* ${buildfolder}/src/static/templates/email/
fi
rm -rf ${vaultwardenlangfrfolder}
2024-06-10 17:55:46 +00:00
TMPDIR=${HOME} DB='sqlite' CONTAINER_REGISTRIES='git.garbaye.fr/garbaye/vaultwarden' BASE_TAGS=${service_version%%-*} ${buildfolder}/docker/podman-bake.sh || retval=false
2023-10-28 15:41:15 +00:00
podman image prune -a -f --filter dangling=true
podman image prune -a -f --filter intermediate=true
2024-05-17 22:08:39 +00:00
podman image rm -f $(podman image list -a -q -- docker.io/vaultwarden/web-vault)
podman image rm -f $(podman image list -a -q -- docker.io/library/rust)
podman image rm -f $(podman image list -a -q -- docker.io/library/debian)
podman image rm -f $(podman image list -a -q -- docker.io/tonistiigi/xx)
2023-10-28 15:41:15 +00:00
fi
2022-11-26 22:00:34 +00:00
rm -rf ${buildfolder}
2023-07-29 07:14:59 +00:00
eval "$retval"
2022-11-26 22:00:34 +00:00
else
echo "Image ${service_image}:${service_version} already built"
fi &&
2022-11-26 22:00:34 +00:00
2023-08-18 16:42:30 +00:00
oci_push_to_registry "${service_image}":"${service_version}"