Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,20 @@ mise run build:binary --target {{target}}
# build a new container
mise run build:docker --platform {{docker_platform}}


# Make the default invocation with `mise run proxy:up` work.
# The default mise environment configuration works for Proxy running as a process, connecting via a port forward.
# Try detecting a running postgres, and use it
if [ "${CS_DATABASE__HOST}" == "localhost" ]; then
{% raw %}
running_postgres="$(docker ps --filter "name=postgres" --filter "health=healthy" --format "{{.Names}};{{.Ports}}" | grep ${CS_DATABASE__PORT})"
running_postgres="$(docker ps --filter "name=postgres" --filter "health=healthy" --format "{{.Names}};{{.Ports}}")"
{% endraw %}
if [ -z "${running_postgres}" ]; then
if [ -z "${running_postgres}" ] || [ -z $(echo ${running_postgres} | grep ${CS_DATABASE__PORT}) ] ; then
echo "error: Could not detect a running, healthy postgres container with port ${CS_DATABASE__PORT}"
echo "error: Try running 'mise run postgres:up' to start a container"
exit 68
fi
echo $running_postgres
export CS_DATABASE__HOST=$(echo $running_postgres | cut -d ';' -f 1)
export CS_DATABASE__HOST=$(echo $running_postgres | grep ${CS_DATABASE__PORT} | cut -d ';' -f 1)
echo "Using postgres running in container: ${CS_DATABASE__HOST}"
fi

Expand Down
Loading