This commit is contained in:
Oleg Sheynin 2024-07-30 12:12:15 -04:00
parent 05bf8e59aa
commit 31a293853c
2 changed files with 19 additions and 2 deletions

View File

@ -19,18 +19,35 @@ is_valid() {
return 1
}
is_container_running() {
local container_name=$1
if [ "$(docker ps --filter "name=^/${container_name}$" --filter "status=running" -q)" ]; then
return 0 # true
else
return 1 # false
fi
}
job=${1}
if ! is_valid "${job}"; then
usage
fi
ContainerName="md_recorder.${job}"
if is_container_running "$ContainerName"; then
echo "Container ${ContainerName} is running."
exit
fi
Cmd="docker run"
Cmd="${Cmd} -d"
Cmd="${Cmd} --rm"
Cmd="${Cmd} --network=host"
Cmd="${Cmd} --pull=always"
Cmd="${Cmd} --name=md_recorder.${job}"
Cmd="${Cmd} --name=${ContainerName}"
Cmd="${Cmd} -v /home/cvtt/prod/data:/app/data"
Cmd="${Cmd} -v /home/cvtt/prod/logs:/logs"
Cmd="${Cmd} cloud21.cvtt.vpn:5500/md_recorder:latest"

View File

@ -1 +1 @@
1.2.3
1.2.4