From 593cb4f0130662cae1d1d2f788ed80594672dfce Mon Sep 17 00:00:00 2001 From: Gitouche Date: Sun, 19 May 2024 15:02:28 +0200 Subject: [PATCH] peerjs : deprov --- podman-peerjs/.gitlab-ci.yml | 21 -------------------- podman-peerjs/00_status.sh | 1 - podman-peerjs/10_install.sh | 18 ----------------- podman-peerjs/20_enable.sh | 1 - podman-peerjs/30_start.sh | 1 - podman-peerjs/40_stop.sh | 1 - podman-peerjs/50_update.sh | 33 -------------------------------- podman-peerjs/70_disable.sh | 1 - podman-peerjs/80_destroy.sh | 1 - podman-peerjs/90_prune.sh | 1 - podman-peerjs/ci_build-images.sh | 30 ----------------------------- podman-peerjs/vars.sh | 11 ----------- 12 files changed, 120 deletions(-) delete mode 100644 podman-peerjs/.gitlab-ci.yml delete mode 120000 podman-peerjs/00_status.sh delete mode 100755 podman-peerjs/10_install.sh delete mode 120000 podman-peerjs/20_enable.sh delete mode 120000 podman-peerjs/30_start.sh delete mode 120000 podman-peerjs/40_stop.sh delete mode 100755 podman-peerjs/50_update.sh delete mode 120000 podman-peerjs/70_disable.sh delete mode 120000 podman-peerjs/80_destroy.sh delete mode 120000 podman-peerjs/90_prune.sh delete mode 100755 podman-peerjs/ci_build-images.sh delete mode 100644 podman-peerjs/vars.sh diff --git a/podman-peerjs/.gitlab-ci.yml b/podman-peerjs/.gitlab-ci.yml deleted file mode 100644 index ab1329d..0000000 --- a/podman-peerjs/.gitlab-ci.yml +++ /dev/null @@ -1,21 +0,0 @@ -# Si besoin d'executer le before_script manuellement : -# sed -n 's/^ - \(.*\)$/\1/p' .gitlab-ci.yml | bash -before_script: - - podman container rm --force podman-peerjs - - rm -f ~/.config/systemd/user/container-podman-peerjs.service && systemctl --user daemon-reload - -peerjs: - stage: test - script: - - cd podman-peerjs - - ./ci_build-images.sh - - GARBAYE_PEERJS_ENV_LISTENPORT=18081 ./10_install.sh - - ./20_enable.sh - - ./30_start.sh && sleep 10 - - ./40_stop.sh - - ./70_disable.sh - - ./80_destroy.sh - tags: - - garbaye - - compute - - podman diff --git a/podman-peerjs/00_status.sh b/podman-peerjs/00_status.sh deleted file mode 120000 index 89a8a9b..0000000 --- a/podman-peerjs/00_status.sh +++ /dev/null @@ -1 +0,0 @@ -../_podman-common/00_status_container.sh \ No newline at end of file diff --git a/podman-peerjs/10_install.sh b/podman-peerjs/10_install.sh deleted file mode 100755 index da632b6..0000000 --- a/podman-peerjs/10_install.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -ABSDIR="$( dirname "$(realpath -s -- "$0")" )" -source ${ABSDIR}/../functions.sh -source ${ABSDIR}/vars.sh - -ensure_pwd_is_scriptdir -ensure_not_root - -ensure_container_not_exists ${container_name} - -if ! podman image exists ${upstream_images}:${version}; then - podman image pull ${upstream_images}:${version} || exit 1 -fi -podman container run --name ${container_name} --user nobody -p ${listen_if}:${listen_port}:9000 -d ${upstream_images}:${version} --port 9000 --path /myapp && -( podman container logs -f ${container_name} 2>&1 & ) | grep -q 'Started PeerServer' && -podman container stop ${container_name} && -echo Container ${container_name} successfully built and stopped. diff --git a/podman-peerjs/20_enable.sh b/podman-peerjs/20_enable.sh deleted file mode 120000 index 62674d2..0000000 --- a/podman-peerjs/20_enable.sh +++ /dev/null @@ -1 +0,0 @@ -../_podman-common/20_enable_container.sh \ No newline at end of file diff --git a/podman-peerjs/30_start.sh b/podman-peerjs/30_start.sh deleted file mode 120000 index 784face..0000000 --- a/podman-peerjs/30_start.sh +++ /dev/null @@ -1 +0,0 @@ -../_podman-common/30_start_container.sh \ No newline at end of file diff --git a/podman-peerjs/40_stop.sh b/podman-peerjs/40_stop.sh deleted file mode 120000 index 3d0c193..0000000 --- a/podman-peerjs/40_stop.sh +++ /dev/null @@ -1 +0,0 @@ -../_podman-common/40_stop_container.sh \ No newline at end of file diff --git a/podman-peerjs/50_update.sh b/podman-peerjs/50_update.sh deleted file mode 100755 index 41ec954..0000000 --- a/podman-peerjs/50_update.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -ABSDIR="$( dirname "$(realpath -s -- "$0")" )" -source ${ABSDIR}/../functions.sh -source ${ABSDIR}/vars.sh - -ensure_pwd_is_scriptdir -ensure_not_root - -ensure_container_exists ${container_name} - -upstream_imageversion=${upstream_images}:${version} -current_imageversion=$(podman container inspect -f '{{.ImageName}}' ${container_name}) - -if [[ "${upstream_imageversion}" == "${current_imageversion}" ]] ; then - echo Container ${container_name} does not need rebuilding. Exiting. - exit 0 -fi - -echo Rebuilding container ${container_name} with image ${upstream_imageversion} - -# pull first for minimal downtime -podman image pull ${upstream_images}:${version} && - -${ABSDIR}/40_stop.sh && -${ABSDIR}/80_destroy.sh && -${ABSDIR}/10_install.sh && -${ABSDIR}/20_enable.sh && -${ABSDIR}/30_start.sh && - -podman image rm ${current_imageversion} && - -${ABSDIR}/00_status.sh diff --git a/podman-peerjs/70_disable.sh b/podman-peerjs/70_disable.sh deleted file mode 120000 index 83e4e91..0000000 --- a/podman-peerjs/70_disable.sh +++ /dev/null @@ -1 +0,0 @@ -../_podman-common/70_disable_container.sh \ No newline at end of file diff --git a/podman-peerjs/80_destroy.sh b/podman-peerjs/80_destroy.sh deleted file mode 120000 index 97efd57..0000000 --- a/podman-peerjs/80_destroy.sh +++ /dev/null @@ -1 +0,0 @@ -../_podman-common/80_destroy_container.sh \ No newline at end of file diff --git a/podman-peerjs/90_prune.sh b/podman-peerjs/90_prune.sh deleted file mode 120000 index 9c9670b..0000000 --- a/podman-peerjs/90_prune.sh +++ /dev/null @@ -1 +0,0 @@ -../_podman-common/90_prune_container.sh \ No newline at end of file diff --git a/podman-peerjs/ci_build-images.sh b/podman-peerjs/ci_build-images.sh deleted file mode 100755 index b555ec4..0000000 --- a/podman-peerjs/ci_build-images.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash - -ABSDIR="$( dirname "$(readlink -f -- "$0")" )" -source "${ABSDIR}"/../functions.sh -source "${ABSDIR}"/vars.sh - -ensure_pwd_is_scriptdir -ensure_not_root - -buildfolder=/tmp/peerjs-server-$$ - -if ! podman image exists ${upstream_images}:${version}; then - mkdir ${buildfolder} && - git clone -b v${version} --depth=1 https://github.com/peers/peerjs-server/ ${buildfolder} && - TMPDIR=${HOME} podman image build \ - --label org.opencontainers.image.description='PeerServer helps establishing connections between PeerJS clients. Data is not proxied through the server.' \ - --label org.opencontainers.image.source='https://github.com/peers/peerjs-server' \ - --label org.opencontainers.image.title='PeerServer' \ - --label org.opencontainers.image.url='https://peerjs.com' \ - -t ${upstream_images}:${version} ${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/node) - rm -rf ${buildfolder} - eval "$retval" -else - echo "Image ${upstream_images}:${version} already built" -fi && - -oci_push_to_registry ${upstream_images}:${version} diff --git a/podman-peerjs/vars.sh b/podman-peerjs/vars.sh deleted file mode 100644 index 2c049d5..0000000 --- a/podman-peerjs/vars.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -## vars -upstream_images='git.garbaye.fr/garbaye/peerjs-server' -version='1.0.2' -## default vars : override with ENV var -listen_if="${GARBAYE_PEERJS_ENV_LISTENIF:-127.0.0.1}" -listen_port="${GARBAYE_PEERJS_ENV_LISTENPORT:-8081}" -## internal vars : do not touch -project_name=${PWD##*/} -container_name="${project_name}" -service_name="container-${container_name}.service"