Skip to content
Snippets Groups Projects

Resolve "Improve update procedure"

Merged Martin Vala requested to merge 55-improve-update-procedure into master
2 files
+ 6
16
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -252,10 +252,8 @@ function eosDockerClean() {
@@ -252,10 +252,8 @@ function eosDockerClean() {
eosDockerStop $t
eosDockerStop $t
$ED_DOCKER_CMD rm eos-$ED_NODE_TYPE
$ED_DOCKER_CMD rm eos-$ED_NODE_TYPE
elif [ "$t" == "fsts" ];then
elif [ "$t" == "fsts" ];then
eosDockerStop $t
[[ $ED_NODE_TYPE == mgm* ]] && [ -f $ED_ROOT_DIR/$ED_FST_HOSTS ] && eos-docker-ssh clean
[[ $ED_NODE_TYPE == mgm* ]] && [ -f $ED_ROOT_DIR/$ED_FST_HOSTS ] && eos-docker-ssh clean
elif [ "$t" == "host" ];then
elif [ "$t" == "host" ];then
eosDockerStop $t
[[ $ED_NODE_TYPE == mgm* ]] && eos-docker-ssh clean $ED_HOSTS_HOST
[[ $ED_NODE_TYPE == mgm* ]] && eos-docker-ssh clean $ED_HOSTS_HOST
fi
fi
done
done
@@ -269,16 +267,12 @@ function eosDockerUpdate() {
@@ -269,16 +267,12 @@ function eosDockerUpdate() {
if [ "$t" == "mgm" -o "$t" == "_single" ];then
if [ "$t" == "mgm" -o "$t" == "_single" ];then
eosDockerPull $t
eosDockerPull $t
eosDockerClean $t
eosDockerClean $t
eosDockerCleanDocker
eosDockerStart $t
eosDockerStart $t
 
eosDockerCleanDocker
elif [ "$t" == "fsts" ];then
elif [ "$t" == "fsts" ];then
eosDockerPull $t
[[ $ED_NODE_TYPE == mgm* ]] && [ -f $ED_ROOT_DIR/$ED_FST_HOSTS ] && eos-docker-ssh update
eosDockerClean $t
eosDockerStart $t
elif [ "$t" == "host" ];then
elif [ "$t" == "host" ];then
eosDockerPull $t
[[ $ED_NODE_TYPE == mgm* ]] && eos-docker-ssh update $ED_HOSTS_HOST
eosDockerClean $t
eosDockerStart $t
fi
fi
done
done
return 0
return 0
@@ -334,10 +328,8 @@ function eosDockerFirewallRemove() {
@@ -334,10 +328,8 @@ function eosDockerFirewallRemove() {
if [ "$t" == "mgm" -o "$t" == "_single" ];then
if [ "$t" == "mgm" -o "$t" == "_single" ];then
eosDockerSetFirewall remove
eosDockerSetFirewall remove
elif [ "$t" == "fsts" ];then
elif [ "$t" == "fsts" ];then
eosDockerStop $t
[[ $ED_NODE_TYPE == mgm* ]] && [ -f $ED_ROOT_DIR/$ED_FST_HOSTS ] && eos-docker-ssh firewall-remove
[[ $ED_NODE_TYPE == mgm* ]] && [ -f $ED_ROOT_DIR/$ED_FST_HOSTS ] && eos-docker-ssh firewall-remove
elif [ "$t" == "host" ];then
elif [ "$t" == "host" ];then
eosDockerStop $t
[[ $ED_NODE_TYPE == mgm* ]] && eos-docker-ssh firewall-remove $ED_HOSTS_HOST
[[ $ED_NODE_TYPE == mgm* ]] && eos-docker-ssh firewall-remove $ED_HOSTS_HOST
fi
fi
done
done
@@ -351,10 +343,8 @@ function eosDockerFirewallPrint() {
@@ -351,10 +343,8 @@ function eosDockerFirewallPrint() {
if [ "$t" == "mgm" -o "$t" == "_single" ];then
if [ "$t" == "mgm" -o "$t" == "_single" ];then
eosDockerSetFirewall print
eosDockerSetFirewall print
elif [ "$t" == "fsts" ];then
elif [ "$t" == "fsts" ];then
eosDockerStop $t
[[ $ED_NODE_TYPE == mgm* ]] && [ -f $ED_ROOT_DIR/$ED_FST_HOSTS ] && eos-docker-ssh firewall-print
[[ $ED_NODE_TYPE == mgm* ]] && [ -f $ED_ROOT_DIR/$ED_FST_HOSTS ] && eos-docker-ssh firewall-print
elif [ "$t" == "host" ];then
elif [ "$t" == "host" ];then
eosDockerStop $t
[[ $ED_NODE_TYPE == mgm* ]] && eos-docker-ssh firewall-print $ED_HOSTS_HOST
[[ $ED_NODE_TYPE == mgm* ]] && eos-docker-ssh firewall-print $ED_HOSTS_HOST
fi
fi
done
done
@@ -362,8 +352,8 @@ function eosDockerFirewallPrint() {
@@ -362,8 +352,8 @@ function eosDockerFirewallPrint() {
}
}
function eosDockerCleanDocker() {
function eosDockerCleanDocker() {
$ED_DOCKER_CMD stop $($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
#$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
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' ..."
INFO "Removing image '$d' ..."
img=$(echo "$d" | cut -d '_' -f1)
img=$(echo "$d" | cut -d '_' -f1)
Loading