fix: gen-migrations workflow
Some checks failed
gen-migrations / gen-migrations (push) Failing after 8s
Some checks failed
gen-migrations / gen-migrations (push) Failing after 8s
This commit is contained in:
parent
e8e69d4790
commit
9929ee928a
@ -7,7 +7,9 @@ jobs:
|
|||||||
!startsWith(gitea.event.head_commit.message, 'chore')
|
!startsWith(gitea.event.head_commit.message, 'chore')
|
||||||
container:
|
container:
|
||||||
image: 'git.orionkindel.com/dnim/db-ci-runner:disheveled-iceberg-launched-loosely'
|
image: 'git.orionkindel.com/dnim/db-ci-runner:disheveled-iceberg-launched-loosely'
|
||||||
volumes: ['/run/user/1001/docker.sock:/run/user/1001/docker.sock']
|
volumes:
|
||||||
|
- '/run/user/1001/docker.sock:/run/user/1001/docker.sock'
|
||||||
|
- '/var/run/postgresql:/var/run/postgresql'
|
||||||
steps:
|
steps:
|
||||||
- uses: 'actions/checkout@v3'
|
- uses: 'actions/checkout@v3'
|
||||||
with: { fetch-depth: 0, ref: 'main', submodules: 'recursive' }
|
with: { fetch-depth: 0, ref: 'main', submodules: 'recursive' }
|
||||||
@ -39,5 +41,6 @@ jobs:
|
|||||||
git push
|
git push
|
||||||
fi
|
fi
|
||||||
env:
|
env:
|
||||||
DOCKER_NETWORK_HOST: 'host.docker.internal'
|
PG_HOST_BASE: '/var/run/postgresql/.s.PGSQL.5432'
|
||||||
|
PG_HOST_HEAD: '/var/run/postgresql/.s.PGSQL.5433'
|
||||||
DOCKER_HOST: 'unix:///run/user/1001/docker.sock' # HACK: rootless docker on gitea action runner
|
DOCKER_HOST: 'unix:///run/user/1001/docker.sock' # HACK: rootless docker on gitea action runner
|
||||||
|
@ -6,11 +6,13 @@ services:
|
|||||||
network_mode: 'host'
|
network_mode: 'host'
|
||||||
image: 'postgres:15.3-bullseye'
|
image: 'postgres:15.3-bullseye'
|
||||||
env_file: ['./.env.schema']
|
env_file: ['./.env.schema']
|
||||||
command: '-p 5432'
|
volumes: ['/var/run/postgresql:/var/run/postgresql']
|
||||||
|
command: '-h localhost -p 5432'
|
||||||
head:
|
head:
|
||||||
container_name: 'head'
|
container_name: 'head'
|
||||||
network_mode: 'host'
|
network_mode: 'host'
|
||||||
image: 'postgres:15.3-bullseye'
|
image: 'postgres:15.3-bullseye'
|
||||||
restart: 'always'
|
restart: 'always'
|
||||||
env_file: ['./.env.schema']
|
env_file: ['./.env.schema']
|
||||||
command: '-p 5433'
|
volumes: ['/var/run/postgresql:/var/run/postgresql']
|
||||||
|
command: '-h localhost -p 5433'
|
||||||
|
@ -10,15 +10,16 @@ rev="$2"
|
|||||||
|
|
||||||
if [[ "$base_or_head" = "head" ]]; then
|
if [[ "$base_or_head" = "head" ]]; then
|
||||||
port=5433
|
port=5433
|
||||||
|
pg_host=${PG_HOST_HEAD:-localhost:$port}
|
||||||
else
|
else
|
||||||
port=5432
|
port=5432
|
||||||
|
pg_host=${PG_HOST_BASE:-localhost:$port}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker compose stop "$base_or_head" 1>/dev/null
|
docker compose stop "$base_or_head" 1>/dev/null
|
||||||
docker compose rm -f "$base_or_head" 1>/dev/null
|
docker compose rm -f "$base_or_head" 1>/dev/null
|
||||||
|
|
||||||
localhost=${DOCKER_NETWORK_HOST:-localhost}
|
url="postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$pg_host"
|
||||||
url="postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$localhost:$port"
|
|
||||||
|
|
||||||
isready() {
|
isready() {
|
||||||
local waited=0
|
local waited=0
|
||||||
|
@ -14,9 +14,11 @@ fi;
|
|||||||
|
|
||||||
migration="./migrations/${base}_to_${head}.sql"
|
migration="./migrations/${base}_to_${head}.sql"
|
||||||
|
|
||||||
localhost=${DOCKER_NETWORK_HOST:-localhost}
|
pg_host_base=${PG_HOST_BASE:-localhost:5432}
|
||||||
base_url="postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$localhost:5432/dnim"
|
pg_host_head=${PG_HOST_HEAD:-localhost:5433}
|
||||||
head_url="postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$localhost:5433/dnim"
|
|
||||||
|
base_url="postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$pg_host_base/dnim"
|
||||||
|
head_url="postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$pg_host_head/dnim"
|
||||||
|
|
||||||
if [[ -z "$base" ]] || [[ -z "$head" ]]; then
|
if [[ -z "$base" ]] || [[ -z "$head" ]]; then
|
||||||
echo "revisions to diff are required ex. ./scripts/diff.sh abc bcd" 1>&2;
|
echo "revisions to diff are required ex. ./scripts/diff.sh abc bcd" 1>&2;
|
||||||
|
Loading…
Reference in New Issue
Block a user