Commit 6e6708b2 authored by Martin Vala's avatar Martin Vala
Browse files

Docker update procedure improved and doker cleanup

parent 2880a51b
Pipeline #607523 skipped with stage
Name: eos-docker-utils
Version: 1.0.12
Version: 1.0.13
Release: 1%{?dist}
Summary: EOS docker utils
License: LGPL v3+
......
......@@ -252,10 +252,8 @@ function eosDockerClean() {
eosDockerStop $t
$ED_DOCKER_CMD rm eos-$ED_NODE_TYPE
elif [ "$t" == "fsts" ];then
eosDockerStop $t
[[ $ED_NODE_TYPE == mgm* ]] && [ -f $ED_ROOT_DIR/$ED_FST_HOSTS ] && eos-docker-ssh clean
elif [ "$t" == "host" ];then
eosDockerStop $t
[[ $ED_NODE_TYPE == mgm* ]] && eos-docker-ssh clean $ED_HOSTS_HOST
fi
done
......@@ -269,16 +267,12 @@ function eosDockerUpdate() {
if [ "$t" == "mgm" -o "$t" == "_single" ];then
eosDockerPull $t
eosDockerClean $t
eosDockerCleanDocker
eosDockerStart $t
eosDockerCleanDocker
elif [ "$t" == "fsts" ];then
eosDockerPull $t
eosDockerClean $t
eosDockerStart $t
[[ $ED_NODE_TYPE == mgm* ]] && [ -f $ED_ROOT_DIR/$ED_FST_HOSTS ] && eos-docker-ssh update
elif [ "$t" == "host" ];then
eosDockerPull $t
eosDockerClean $t
eosDockerStart $t
[[ $ED_NODE_TYPE == mgm* ]] && eos-docker-ssh update $ED_HOSTS_HOST
fi
done
return 0
......@@ -334,10 +328,8 @@ function eosDockerFirewallRemove() {
if [ "$t" == "mgm" -o "$t" == "_single" ];then
eosDockerSetFirewall remove
elif [ "$t" == "fsts" ];then
eosDockerStop $t
[[ $ED_NODE_TYPE == mgm* ]] && [ -f $ED_ROOT_DIR/$ED_FST_HOSTS ] && eos-docker-ssh firewall-remove
elif [ "$t" == "host" ];then
eosDockerStop $t
[[ $ED_NODE_TYPE == mgm* ]] && eos-docker-ssh firewall-remove $ED_HOSTS_HOST
fi
done
......@@ -351,10 +343,8 @@ function eosDockerFirewallPrint() {
if [ "$t" == "mgm" -o "$t" == "_single" ];then
eosDockerSetFirewall print
elif [ "$t" == "fsts" ];then
eosDockerStop $t
[[ $ED_NODE_TYPE == mgm* ]] && [ -f $ED_ROOT_DIR/$ED_FST_HOSTS ] && eos-docker-ssh firewall-print
elif [ "$t" == "host" ];then
eosDockerStop $t
[[ $ED_NODE_TYPE == mgm* ]] && eos-docker-ssh firewall-print $ED_HOSTS_HOST
fi
done
......@@ -362,8 +352,8 @@ function eosDockerFirewallPrint() {
}
function eosDockerCleanDocker() {
$ED_DOCKER_CMD stop $($ED_DOCKER_CMD ps --format "{{.Names}}" | grep eos-)> /dev/null 2>&1
$ED_DOCKER_CMD rm $($ED_DOCKER_CMD ps --format "{{.Names}}" | grep eos-)> /dev/null 2>&1
#$ED_DOCKER_CMD stop $($ED_DOCKER_CMD ps --format "{{.Names}}" | grep eos-)> /dev/null 2>&1
#$ED_DOCKER_CMD rm $($ED_DOCKER_CMD ps --format "{{.Names}}" | grep eos-)> /dev/null 2>&1
for d in $($ED_DOCKER_CMD images --format "{{.ID}}_{{.Repository}}:{{.Tag}}" --filter=reference=$ED_DOCKER_PREFIX/$(echo $ED_DOCKER_IMAGE_NAME_VERSION | cut -d ':' -f1) | grep -v $ED_DOCKER_PREFIX/$ED_DOCKER_IMAGE_NAME_VERSION); do
INFO "Removing image '$d' ..."
img=$(echo "$d" | cut -d '_' -f1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment