Browse Source

fix: [vps] support of services not using a frontend to command requiring url

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
rc1
Valentin Lab 3 years ago
parent
commit
2a26c75764
  1. 11
      bin/vps

11
bin/vps

@ -597,7 +597,16 @@ compose:get_url() {
container_id=$(compose:service:container_one "${project_name}" "${service}") || return 1 container_id=$(compose:service:container_one "${project_name}" "${service}") || return 1
network_ip=$(docker:container:network_ip_one "${container_id}") || return 1 network_ip=$(docker:container:network_ip_one "${container_id}") || return 1
IFS=":" read -r network ip <<<"$network_ip" IFS=":" read -r network ip <<<"$network_ip"
echo "http://$ip"
tcp_port=
for port in $(docker:exposed_ports "$container_id"); do
IFS="/" read port type <<<"$port"
[ "$type" == "tcp" ] || continue
tcp_port="$port"
break
done
echo -n "http://$ip"
[ -n "$tcp_port" ] && echo ":$tcp_port"
fi || { fi || {
err "Failed querying ${service} to frontend relation to get url." err "Failed querying ${service} to frontend relation to get url."
return 1 return 1

Loading…
Cancel
Save