peerjs : preparation uniformisation fonctionnement pour 1 container pas de pod

This commit is contained in:
Gitouche 2022-02-10 21:25:52 +01:00
parent cbf36cefeb
commit ec0d3ff9cd
5 changed files with 12 additions and 7 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
ABSDIR="$( dirname "$(realpath -s -- "$0")" )"
source ${ABSDIR}/../functions.sh
source ${ABSDIR}/vars.sh
@ -8,10 +8,12 @@ ensure_pwd_is_scriptdir
ensure_not_root
echo "Podman images status..."
podman images ${upstream_image}
for image in ${upstream_images} ; do
podman images ${image} | grep ${image} || echo Image ${image} not found.
done
echo
echo "Checking container status..."
podman ps -a | grep ${container_name}
podman ps -a | grep ${container_name} || echo container ${container_name} not found.
echo
echo "Checking systemd unit status..."
systemctl --user status ${service_name}

View File

@ -9,4 +9,4 @@ ensure_not_root
ensure_container_not_exists ${container_name}
podman run --name ${container_name} --user nobody -p ${listen_if}:${listen_port}:9000 -d ${upstream_image}:${upstream_version} && podman stop ${container_name} && echo Container ${container_name} successfully built and stopped.
podman run --name ${container_name} --user nobody -p ${listen_if}:${listen_port}:9000 -d ${upstream_images}:${upstream_version} && podman stop ${container_name} && echo Container ${container_name} successfully built and stopped.

View File

@ -9,7 +9,7 @@ ensure_not_root
ensure_container_exists ${container_name}
upstream_imageversion=${upstream_image}:${upstream_version}
upstream_imageversion=${upstream_images}:${upstream_version}
current_imageversion=$(podman container inspect -f '{{.ImageName}}' ${container_name})
if [[ "${upstream_imageversion}" == "${current_imageversion}" ]] ; then

View File

@ -16,4 +16,7 @@ ensure_container_not_exists ${container_name}
# FAIL if systemd unit exists
ensure_systemd_unit_not_exists ${service_name}
podman rmi "$(podman images -a -q -- ${upstream_image})" || echo 'No images to remove.'
# remove images
for image in ${upstream_images} ; do
podman rmi $(podman images -a -q -- ${image}) || echo Image ${image} not found.
done

View File

@ -4,5 +4,5 @@ container_name='peerjs-server'
service_name="container_${container_name}.service"
listen_if='127.0.0.1'
listen_port='9000'
upstream_image='docker.io/peerjs/peerjs-server'
upstream_images='docker.io/peerjs/peerjs-server'
upstream_version='0.6.1'