Browse Source

chg: dev: [odoo-tecnativa] refactor out and strengthen detection of running container

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
pull/19/head
Valentin Lab 3 years ago
parent
commit
cdcb310c93
  1. 16
      odoo-tecnativa/actions/drop
  2. 16
      odoo-tecnativa/actions/load
  3. 17
      odoo-tecnativa/actions/save

16
odoo-tecnativa/actions/drop

@ -96,18 +96,14 @@ ADMIN_PASSWORD=$(echo "$service_def" | shyaml -q get-value options.admin-passwor
fi
}
containers="$(get_running_containers_for_service "$SERVICE_NAME")"
if [ -z "$containers" ]; then
err "No containers running for service $DARKYELLOW$SERVICE_NAME$NORMAL."
die "Please ensure that $DARKYELLOW$SERVICE_NAME$NORMAL is running before using '$exname'."
fi
container_network_ip=$(get_healthy_container_ip_for_service "$SERVICE_NAME" 8069 4) || {
err "Please ensure that $DARKYELLOW$service$NORMAL is running before using '$exname'."
exit 1
}
## XXXvlab: taking first container is probably not a good idea
container="$(echo "$containers" | head -n 1)"
container_ip=${container_network_ip##*:}
container_network=${container_network_ip%%:*}
## XXXvlab: taking first ip is probably not a good idea
read-0 container_network container_ip < <(get_container_network_ip "$container")
DEFAULT_CURL_IMAGE=${DEFAULT_CURL_IMAGE:-docker.0k.io/curl}

16
odoo-tecnativa/actions/load

@ -97,18 +97,14 @@ ADMIN_PASSWORD=$(echo "$service_def" | shyaml -q get-value options.admin-passwor
fi
}
containers="$(get_running_containers_for_service "$SERVICE_NAME")"
if [ -z "$containers" ]; then
err "No containers running for service $DARKYELLOW$SERVICE_NAME$NORMAL."
die "Please ensure that $DARKYELLOW$SERVICE_NAME$NORMAL is running before using '$exname'."
fi
container_network_ip=$(get_healthy_container_ip_for_service "$SERVICE_NAME" 8069 4) || {
err "Please ensure that $DARKYELLOW$service$NORMAL is running before using '$exname'."
exit 1
}
## XXXvlab: taking first container is probably not a good idea
container="$(echo "$containers" | head -n 1)"
container_ip=${container_network_ip##*:}
container_network=${container_network_ip%%:*}
## XXXvlab: taking first ip is probably not a good idea
read-0 container_network container_ip < <(get_container_network_ip "$container")
DEFAULT_CURL_IMAGE=${DEFAULT_CURL_IMAGE:-docker.0k.io/curl}

17
odoo-tecnativa/actions/save

@ -96,18 +96,13 @@ ADMIN_PASSWORD=$(echo "$service_def" | shyaml -q get-value options.admin-passwor
fi
}
containers="$(get_running_containers_for_service "$SERVICE_NAME")"
if [ -z "$containers" ]; then
err "No containers running for service $DARKYELLOW$SERVICE_NAME$NORMAL."
die "Please ensure that $DARKYELLOW$SERVICE_NAME$NORMAL is running before using '$exname'."
fi
## XXXvlab: taking first container is probably not a good idea
container="$(echo "$containers" | head -n 1)"
container_network_ip=$(get_healthy_container_ip_for_service "$SERVICE_NAME" 8069 4) || {
err "Please ensure that $DARKYELLOW$service$NORMAL is running before using '$exname'."
exit 1
}
## XXXvlab: taking first ip is probably not a good idea
read-0 container_network container_ip < <(get_container_network_ip "$container")
container_ip=${container_network_ip##*:}
container_network=${container_network_ip%%:*}
DEFAULT_CURL_IMAGE=${DEFAULT_CURL_IMAGE:-docker.0k.io/curl}

Loading…
Cancel
Save