You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

20 lines
473 B

#!/bin/bash
set -e
. ./.env
. ./.env.private
export DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@127.0.0.1/${POSTGRES_DATABASE}
IMG_NAME=pg-schema
docker run --rm -d \
--env-file=$PWD/.env \
--env-file=$PWD/.env.private \
--name $IMG_NAME \
-p 5432:5432 \
postgres:14.5
timeout 10s grep -q 'system is ready to accept connections' <(docker logs --follow $IMG_NAME)
sleep 0.5
diesel setup && diesel migration run
docker stop $IMG_NAME