fix: gen-migrations workflow
Some checks failed
gen-migrations / gen-migrations (push) Failing after 7s

This commit is contained in:
Orion Kindel 2023-07-19 18:53:13 -05:00
parent 6f08ab4201
commit c1c9c67866
Signed by untrusted user who does not match committer: orion
GPG Key ID: 6D4165AE4C928719
3 changed files with 6 additions and 10 deletions

View File

@ -41,6 +41,5 @@ jobs:
git push
fi
env:
PG_HOST_BASE: '/var/run/postgresql/.s.PGSQL.5432'
PG_HOST_HEAD: '/var/run/postgresql/.s.PGSQL.5433'
PG_HOST: '%2Fvar%2Flib%2Fpostgresql'
DOCKER_HOST: 'unix:///run/user/1001/docker.sock' # HACK: rootless docker on gitea action runner

View File

@ -10,16 +10,15 @@ rev="$2"
if [[ "$base_or_head" = "head" ]]; then
port=5433
pg_host=${PG_HOST_HEAD:-localhost:$port}
else
port=5432
pg_host=${PG_HOST_BASE:-localhost:$port}
fi
docker compose stop "$base_or_head" 1>/dev/null
docker compose rm -f "$base_or_head" 1>/dev/null
url="postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$pg_host"
pg_host=${PG_HOST:-localhost}
url="postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$pg_host:$port"
isready() {
local waited=0

View File

@ -14,11 +14,9 @@ fi;
migration="./migrations/${base}_to_${head}.sql"
pg_host_base=${PG_HOST_BASE:-localhost:5432}
pg_host_head=${PG_HOST_HEAD:-localhost:5433}
base_url="postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$pg_host_base/dnim"
head_url="postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$pg_host_head/dnim"
pg_host=${PG_HOST:-localhost}
base_url="postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$pg_host:5432/dnim"
head_url="postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$pg_host:5433/dnim"
if [[ -z "$base" ]] || [[ -z "$head" ]]; then
echo "revisions to diff are required ex. ./scripts/diff.sh abc bcd" 1>&2;