create database
This commit is contained in:
parent
65e2dea2fc
commit
32ef6f36a4
1 changed files with 10 additions and 1 deletions
|
|
@ -22,5 +22,14 @@ steps:
|
||||||
cp ~/dbt-ci/.env .
|
cp ~/dbt-ci/.env .
|
||||||
echo "POSTGRES_DATABASE=${BUILD_SOURCEBRANCH#refs/heads/}" >> .env
|
echo "POSTGRES_DATABASE=${BUILD_SOURCEBRANCH#refs/heads/}" >> .env
|
||||||
set -a && source .env && set +a
|
set -a && source .env && set +a
|
||||||
|
|
||||||
psql -h $POSTGRES_HOST -U $POSTGRES_USER -d postgres -c "SELECT 1 FROM pg_database WHERE datname = 'postgres';"
|
psql -h $POSTGRES_HOST -U $POSTGRES_USER -d postgres -c "SELECT 1 FROM pg_database WHERE datname = 'postgres';"
|
||||||
displayName: 'Smoke test Postgres connection'
|
displayName: 'Smoke test Postgres connection'
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
cp ~/dbt-ci/.env .
|
||||||
|
echo "POSTGRES_DATABASE=${BUILD_SOURCEBRANCH#refs/heads/}" >> .env
|
||||||
|
set -a && source .env && set +a
|
||||||
|
|
||||||
|
psql -h $POSTGRES_HOST -U $POSTGRES_USER -d postgres -c "CREATE DATABASE ci_${BUILD_SOURCEBRANCH#refs/heads/}""
|
||||||
|
displayName: 'Create branch dedicated database'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue