Browse Source

new: [vps] make ``restore`` check-fix odoo container before restore

The ``load`` action will rely on using ``docker exec`` so we need to ensure
that it is working.
pull/6/head
Valentin Lab 10 months ago
parent
commit
9d8843e94e
  1. 17
      bin/vps

17
bin/vps

@ -1077,13 +1077,13 @@ docker restart "$container_id"
sleep 2 sleep 2
docker restart "$container_id" docker restart "$container_id"
EOF EOF
return $errlvl
return 2
fi fi
warn "Unknown issue with ${DARKYELLOW}$service_name${NORMAL}'s container:" warn "Unknown issue with ${DARKYELLOW}$service_name${NORMAL}'s container:"
echo " ${WHITE}cmd:${NORMAL} docker exec -ti $container_id echo" >&2 echo " ${WHITE}cmd:${NORMAL} docker exec -ti $container_id echo" >&2
echo "$out" | prefix " ${DARKGRAY}|${NORMAL} " >&2 echo "$out" | prefix " ${DARKGRAY}|${NORMAL} " >&2
echo " ${DARKGRAY}..${NORMAL} leaving this as-is." echo " ${DARKGRAY}..${NORMAL} leaving this as-is."
return $errlvl
return 1
} }
docker:api() { docker:api() {
@ -1650,7 +1650,18 @@ cmdline.spec:odoo:cmd:restore:run() {
opts_load=() opts_load=()
[ "$opt_neutralize" ] && opts_load+=("--neutralize") [ "$opt_neutralize" ] && opts_load+=("--neutralize")
#cmdline.spec:odoo:cmd:restart:run --service "$odoo_service" || exit 1
project_name=$(compose:project_name) || exit 1
container:health:check-fix:no-matching-entries "${project_name}_${odoo_service}_1"
case "$?" in
0)
debug "Container ${project_name}_${odoo_service}_1 is healthy."
;;
1) err "Container ${project_name}_${odoo_service}_1 is not healthy."
exit 1
;;
2) info "Container ${project_name}_${odoo_service}_1 was fixed."
;;
esac
msg_dbname=default msg_dbname=default
[ -n "$opt_database" ] && msg_dbname="'$opt_database'" [ -n "$opt_database" ] && msg_dbname="'$opt_database'"

Loading…
Cancel
Save