improve postgres

This commit is contained in:
Lunny Xiao 2018-10-05 22:41:32 +08:00
parent d05b615b01
commit e9a64a3f5e
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 12 additions and 2 deletions

View File

@ -22,8 +22,6 @@ services:
environment:
- POSTGRES_USER=postgres
- POSTGRES_DB=xorm_test
commands:
- psql xorm_test postgres -c "create schema xorm"
when:
event: [ push, tag, pull_request ]
@ -45,6 +43,18 @@ matrix:
- 1.11
pipeline:
init_postgres:
image: postgres:9.5
commands:
# wait for postgres service to become available
- |
until psql -U postgres -d xorm_test -h pgsql \
-c "SELECT 1;" >/dev/null 2>&1; do sleep 1; done
# query the database
- |
psql -U postgres -d xorm_test -h pgsql \
-c "create schema xorm;"
build:
image: golang:${GO_VERSION}
commands: