2022-02-24 21:45:31 +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-02-24 21:45:31 +00:00
|
|
|
|
|
|
|
ensure_pwd_is_scriptdir
|
|
|
|
ensure_not_root
|
|
|
|
|
2022-03-05 09:30:15 +00:00
|
|
|
buildfolder=/tmp/docker-jitsi-meet-$$
|
|
|
|
|
2022-08-05 14:01:01 +00:00
|
|
|
build_base() {
|
2023-04-21 11:53:55 +00:00
|
|
|
podman image pull docker.io/library/debian:bullseye-slim
|
2022-02-25 09:04:04 +00:00
|
|
|
if ! podman image exists localhost/jitsi/base:${version}; then
|
2023-04-21 11:53:55 +00:00
|
|
|
podman image build -t localhost/jitsi/base:${version} ${buildfolder}/base/ &&
|
2023-07-29 07:14:59 +00:00
|
|
|
podman image tag localhost/jitsi/base:${version} localhost/jitsi/base:latest || exit 255
|
2022-02-25 09:04:04 +00:00
|
|
|
fi
|
|
|
|
if ! podman image exists localhost/jitsi/base-java:${version}; then
|
2023-04-21 11:53:55 +00:00
|
|
|
podman image build -t localhost/jitsi/base-java:${version} ${buildfolder}/base-java &&
|
2023-07-29 07:14:59 +00:00
|
|
|
podman image tag localhost/jitsi/base-java:${version} localhost/jitsi/base-java:latest || exit 255
|
2022-02-25 09:04:04 +00:00
|
|
|
fi
|
2022-08-05 14:01:01 +00:00
|
|
|
base_cleanup=true
|
|
|
|
}
|
|
|
|
|
|
|
|
mkdir ${buildfolder} &&
|
2023-07-29 07:14:59 +00:00
|
|
|
if curl -sSfL -- "https://github.com/jitsi/docker-jitsi-meet/archive/refs/tags/${version}.tar.gz" | tar xz --strip-components 1 -C ${buildfolder}/ ; then
|
2022-08-12 19:01:57 +00:00
|
|
|
if ! podman image exists git.garbaye.fr/garbaye/jitsi-jvb:${version}; then
|
2022-08-05 14:01:01 +00:00
|
|
|
build_base
|
2023-07-29 07:14:59 +00:00
|
|
|
podman image build -t git.garbaye.fr/garbaye/jitsi-jvb:${version} ${buildfolder}/jvb/ || exit 255
|
2022-02-25 09:04:04 +00:00
|
|
|
fi
|
2022-08-12 19:01:57 +00:00
|
|
|
if ! podman image exists git.garbaye.fr/garbaye/jitsi-jicofo:${version}; then
|
2022-08-05 14:01:01 +00:00
|
|
|
build_base
|
2023-07-29 07:14:59 +00:00
|
|
|
podman image build -t git.garbaye.fr/garbaye/jitsi-jicofo:${version} ${buildfolder}/jicofo/ || exit 255
|
2022-02-25 09:04:04 +00:00
|
|
|
fi
|
2022-08-12 19:01:57 +00:00
|
|
|
if ! podman image exists git.garbaye.fr/garbaye/jitsi-prosody:${version}; then
|
2022-08-05 14:01:01 +00:00
|
|
|
build_base
|
2023-07-29 07:14:59 +00:00
|
|
|
podman image build -t git.garbaye.fr/garbaye/jitsi-prosody:${version} ${buildfolder}/prosody/ || exit 255
|
2022-02-25 09:04:04 +00:00
|
|
|
fi
|
2022-08-12 19:01:57 +00:00
|
|
|
if ! podman image exists git.garbaye.fr/garbaye/jitsi-web:${version}; then
|
2022-08-05 14:01:01 +00:00
|
|
|
build_base
|
2023-07-29 07:14:59 +00:00
|
|
|
podman image build -t git.garbaye.fr/garbaye/jitsi-web:${version} ${buildfolder}/web/ || exit 255
|
2022-02-25 09:04:04 +00:00
|
|
|
fi
|
2023-10-28 15:41:15 +00:00
|
|
|
podman image prune -a -f --filter dangling=true
|
|
|
|
podman image prune -a -f --filter intermediate=true
|
2023-07-29 07:14:59 +00:00
|
|
|
if [ -n "${base_cleanup}" ] ; then
|
2023-04-21 11:53:55 +00:00
|
|
|
podman image rm localhost/jitsi/base-java:${version} localhost/jitsi/base-java:latest
|
|
|
|
podman image rm localhost/jitsi/base:${version} localhost/jitsi/base:latest
|
2022-08-05 14:01:01 +00:00
|
|
|
fi
|
2023-07-29 07:14:59 +00:00
|
|
|
fi
|
|
|
|
rm -rf ${buildfolder}
|
2022-08-12 19:08:18 +00:00
|
|
|
|
|
|
|
for image in ${upstream_images}; do
|
2023-07-29 07:14:59 +00:00
|
|
|
oci_push_to_registry "${image}":${version}
|
2022-08-12 19:09:19 +00:00
|
|
|
done
|