From eeb05124914b704d2ff93580450b863f10e5c6a5 Mon Sep 17 00:00:00 2001 From: Gitouche <26656-gitouche@users.noreply.framagit.org> Date: Thu, 24 Feb 2022 22:45:31 +0100 Subject: [PATCH] Jitsi : build your own images! --- _podman-common/90_prune_container.sh | 2 +- _podman-common/90_prune_pod.sh | 2 +- podman-jitsi/.gitlab-ci.yml | 2 +- podman-jitsi/10_install.sh | 3 ++- podman-jitsi/50_update.sh | 4 +--- podman-jitsi/vars.sh | 2 +- podman-jitsi/zz_build-images.sh | 28 ++++++++++++++++++++++++++++ 7 files changed, 35 insertions(+), 8 deletions(-) create mode 100755 podman-jitsi/zz_build-images.sh diff --git a/_podman-common/90_prune_container.sh b/_podman-common/90_prune_container.sh index d33c1a2..0ef9123 100755 --- a/_podman-common/90_prune_container.sh +++ b/_podman-common/90_prune_container.sh @@ -18,5 +18,5 @@ ensure_systemd_unit_not_exists ${service_name} # remove images for image in ${upstream_images} ; do - podman rmi $(podman images -a -q -- ${image}) || echo Image ${image} not found. + podman rmi -f $(podman images -a -q -- ${image}) || echo Image ${image} not found. done diff --git a/_podman-common/90_prune_pod.sh b/_podman-common/90_prune_pod.sh index afe3bad..0bfdb2c 100755 --- a/_podman-common/90_prune_pod.sh +++ b/_podman-common/90_prune_pod.sh @@ -18,5 +18,5 @@ ensure_systemd_unit_not_exists ${service_name} # remove images for image in ${upstream_images} ; do - podman rmi $(podman images -a -q -- ${image}) || echo Image ${image} not found. + podman rmi -f $(podman images -a -q -- ${image}) || echo Image ${image} not found. done diff --git a/podman-jitsi/.gitlab-ci.yml b/podman-jitsi/.gitlab-ci.yml index e256eea..3e1b7a3 100644 --- a/podman-jitsi/.gitlab-ci.yml +++ b/podman-jitsi/.gitlab-ci.yml @@ -12,7 +12,7 @@ jitsi: - ./30_start.sh && sleep 10 - ./40_stop.sh - ./30_start.sh && sleep 10 - - ./50_update.sh + - GARBAYE_JITSI_ENV_LISTENPORT=18085 ./50_update.sh - ./40_stop.sh - ./70_disable.sh - ./80_destroy.sh diff --git a/podman-jitsi/10_install.sh b/podman-jitsi/10_install.sh index f4bfecc..2392f19 100755 --- a/podman-jitsi/10_install.sh +++ b/podman-jitsi/10_install.sh @@ -14,6 +14,8 @@ if [[ -d ~/${confvolume} ]]; then exit 1 fi +source ${ABSDIR}/zz_build-images.sh + mkdir -p ~/${confvolume}/{web/letsencrypt,web/crontabs,transcripts,prosody/config,prosody/prosody-plugins-custom,jicofo,jvb,jigasi,jibri} # Patch config.js @@ -35,7 +37,6 @@ cp env.example .env ./gen-passwords.sh # Patch docker-compose.yml -sed_in_place "^ image: jitsi/" " image: docker.io/jitsi/" docker-compose.yml sed_in_place "^ environment:" " env_file:\n - .env\n environment:" docker-compose.yml sed_in_place "^ - '\${JVB_TCP_PORT}:\${JVB_TCP_PORT}'" "# - '\${JVB_TCP_PORT}:\${JVB_TCP_PORT}'" docker-compose.yml sed_in_place "^ - '\${HTTP_PORT}:80'" " - '\${listen_if}:\${HTTP_PORT}:80'" docker-compose.yml diff --git a/podman-jitsi/50_update.sh b/podman-jitsi/50_update.sh index dc66cc9..b64645d 100755 --- a/podman-jitsi/50_update.sh +++ b/podman-jitsi/50_update.sh @@ -13,9 +13,7 @@ ensure_systemd_unit_exists ${service_name} current_version=$(podman ps -a --format "{{.Image}}" | grep prosody | awk -F: '{print $NF}') reinstall_please () { - for image in ${upstream_images}; do - podman pull ${image}:${version} || exit 1 - done + source ${ABSDIR}/zz_build-images.sh check_pod_running ${pod_name} && ./40_stop.sh ./70_disable.sh && \ ./80_destroy.sh && \ diff --git a/podman-jitsi/vars.sh b/podman-jitsi/vars.sh index d609435..d4c0fec 100644 --- a/podman-jitsi/vars.sh +++ b/podman-jitsi/vars.sh @@ -2,7 +2,7 @@ pod_name='podman-jitsi' service_name="pod-${pod_name}.service" -upstream_images="docker.io/jitsi/jvb docker.io/jitsi/jicofo docker.io/jitsi/prosody docker.io/jitsi/web" +upstream_images="localhost/jitsi/base localhost/jitsi/base-java localhost/jitsi/jvb localhost/jitsi/jicofo localhost/jitsi/prosody localhost/jitsi/web" version='stable-6865' confvolume='.jitsi-meet-cfg' listen_if="${GARBAYE_JITSI_ENV_LISTENIF:-127.0.0.1}" diff --git a/podman-jitsi/zz_build-images.sh b/podman-jitsi/zz_build-images.sh new file mode 100755 index 0000000..10edb1c --- /dev/null +++ b/podman-jitsi/zz_build-images.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +ABSDIR="$( dirname "$(readlink -f -- "$0")" )" +source ${ABSDIR}/../functions.sh +source ${ABSDIR}/vars.sh + +ensure_pwd_is_scriptdir +ensure_not_root + +mkdir docker-jitsi-meet && +curl -s -- "https://codeload.github.com/jitsi/docker-jitsi-meet/tar.gz/refs/tags/stable-6865" | tar xz --strip-components 1 -C docker-jitsi-meet/ && { + podman pull docker.io/library/debian:bullseye-slim + podman image exists localhost/jitsi/base:${version} || { + podman build -t localhost/jitsi/base:${version} docker-jitsi-meet/base/ && + podman image tag localhost/jitsi/base:${version} localhost/jitsi/base:latest + } + podman image exists localhost/jitsi/base-java:${version} || { + podman build -t localhost/jitsi/base-java:${version} docker-jitsi-meet/base-java && + podman image tag localhost/jitsi/base-java:${version} localhost/jitsi/base-java:latest + } + podman image exists localhost/jitsi/jvb:${version} || podman build -t localhost/jitsi/jvb:${version} docker-jitsi-meet/jvb/ + podman image exists localhost/jitsi/jicofo:${version} || podman build -t localhost/jitsi/jicofo:${version} docker-jitsi-meet/jicofo/ + podman image exists localhost/jitsi/prosody:${version} || podman build -t localhost/jitsi/prosody:${version} docker-jitsi-meet/prosody/ + podman image exists localhost/jitsi/web:${version} || { + podman build -t localhost/jitsi/web:${version} docker-jitsi-meet/web/ + podman rmi -f $(podman images -f "dangling=true" -q) + } +} ; rm -rf docker-jitsi-meet