fix: gen-migrations workflow
Some checks failed
gen-migrations / gen-migrations (push) Failing after 7s
Some checks failed
gen-migrations / gen-migrations (push) Failing after 7s
This commit is contained in:
parent
6f08ab4201
commit
c1c9c67866
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user