24 lines
530 B
Bash
Executable File
24 lines
530 B
Bash
Executable File
#! /bin/bash
|
|
|
|
set -e
|
|
|
|
source ./scripts/env.sh ./.env.schema
|
|
|
|
rev=${1:-}
|
|
|
|
head_url=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB
|
|
base_url=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5433/$POSTGRES_DB
|
|
|
|
if [[ -z "$rev" ]]; then
|
|
echo "revision to diff is required";
|
|
exit 1;
|
|
fi
|
|
|
|
docker compose up -d
|
|
|
|
./scripts/build.sh $rev
|
|
./scripts/build.sh HEAD
|
|
|
|
echo "migrate from $rev => HEAD" 1>&2
|
|
migra --unsafe $base_url $head_url || echo "migra exited with code $?. this is /probably/ fine" 1>&2
|