File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,21 +76,20 @@ mise run build:binary --target {{target}}
7676# build a new container
7777mise run build:docker --platform {{docker_platform}}
7878
79-
8079# Make the default invocation with `mise run proxy:up` work.
8180# The default mise environment configuration works for Proxy running as a process, connecting via a port forward.
8281# Try detecting a running postgres, and use it
8382if [ "${CS_DATABASE__HOST}" == "localhost" ]; then
8483 {% raw %}
85- running_postgres="$(docker ps --filter "name=postgres" --filter "health=healthy" --format "{{.Names}};{{.Ports}}" | grep ${CS_DATABASE__PORT} )"
84+ running_postgres="$(docker ps --filter "name=postgres" --filter "health=healthy" --format "{{.Names}};{{.Ports}}")"
8685 {% endraw %}
87- if [ -z "${running_postgres}" ]; then
86+ if [ -z "${running_postgres}" ] || [ -z $(echo ${running_postgres} | grep ${CS_DATABASE__PORT}) ] ; then
8887 echo "error: Could not detect a running, healthy postgres container with port ${CS_DATABASE__PORT}"
8988 echo "error: Try running 'mise run postgres:up' to start a container"
9089 exit 68
9190 fi
9291 echo $running_postgres
93- export CS_DATABASE__HOST=$(echo $running_postgres | cut -d ';' -f 1)
92+ export CS_DATABASE__HOST=$(echo $running_postgres | grep ${CS_DATABASE__PORT} | cut -d ';' -f 1)
9493 echo "Using postgres running in container: ${CS_DATABASE__HOST}"
9594fi
9695
You can’t perform that action at this time.
0 commit comments