From e9a64a3f5e95e978c0bc878c7a8466941adc3a9a Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 5 Oct 2018 22:41:32 +0800 Subject: [PATCH] improve postgres --- .drone.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 8954ec0b..dd23add5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -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: