peerjs : preparation uniformisation fonctionnement pour 1 container pas de pod
This commit is contained in:
parent
cbf36cefeb
commit
ec0d3ff9cd
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
|
ABSDIR="$( dirname "$(realpath -s -- "$0")" )"
|
||||||
source ${ABSDIR}/../functions.sh
|
source ${ABSDIR}/../functions.sh
|
||||||
source ${ABSDIR}/vars.sh
|
source ${ABSDIR}/vars.sh
|
||||||
|
|
||||||
|
@ -8,10 +8,12 @@ ensure_pwd_is_scriptdir
|
||||||
ensure_not_root
|
ensure_not_root
|
||||||
|
|
||||||
echo "Podman images status..."
|
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
|
||||||
echo "Checking container status..."
|
echo "Checking container status..."
|
||||||
podman ps -a | grep ${container_name}
|
podman ps -a | grep ${container_name} || echo container ${container_name} not found.
|
||||||
echo
|
echo
|
||||||
echo "Checking systemd unit status..."
|
echo "Checking systemd unit status..."
|
||||||
systemctl --user status ${service_name}
|
systemctl --user status ${service_name}
|
||||||
|
|
|
@ -9,4 +9,4 @@ ensure_not_root
|
||||||
|
|
||||||
ensure_container_not_exists ${container_name}
|
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.
|
||||||
|
|
|
@ -9,7 +9,7 @@ ensure_not_root
|
||||||
|
|
||||||
ensure_container_exists ${container_name}
|
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})
|
current_imageversion=$(podman container inspect -f '{{.ImageName}}' ${container_name})
|
||||||
|
|
||||||
if [[ "${upstream_imageversion}" == "${current_imageversion}" ]] ; then
|
if [[ "${upstream_imageversion}" == "${current_imageversion}" ]] ; then
|
||||||
|
|
|
@ -16,4 +16,7 @@ ensure_container_not_exists ${container_name}
|
||||||
# FAIL if systemd unit exists
|
# FAIL if systemd unit exists
|
||||||
ensure_systemd_unit_not_exists ${service_name}
|
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
|
||||||
|
|
|
@ -4,5 +4,5 @@ container_name='peerjs-server'
|
||||||
service_name="container_${container_name}.service"
|
service_name="container_${container_name}.service"
|
||||||
listen_if='127.0.0.1'
|
listen_if='127.0.0.1'
|
||||||
listen_port='9000'
|
listen_port='9000'
|
||||||
upstream_image='docker.io/peerjs/peerjs-server'
|
upstream_images='docker.io/peerjs/peerjs-server'
|
||||||
upstream_version='0.6.1'
|
upstream_version='0.6.1'
|
||||||
|
|
Loading…
Reference in a new issue