工作摊位(END)

时间:2015-10-16 16:49:56

标签: postgresql travis-ci

我正在尝试在travis上设置两个数据库,但它只是在before_install声明中途停止:

(END)

No output has been received in the last 10 minutes, this potentially indicates a stalled build or something wrong with the build itself.
The build has been terminated

例如https://travis-ci.org/B3Partners/brmo/builds/85746119

我的yml如下:

language: java

sudo: false

branches:
  only:
    - travis-integration

addons:
  postgresql: "9.3"

jdk:
#  - openjdk6
#  - openjdk7
  - oraclejdk7
#  - oraclejdk8

matrix:
  fast_finish: true

cache:
  directories:
  - $HOME/.m2

before_install:
  # STAGING
  - psql --version
  - psql -U postgres -c 'create database staging'
  - psql -U postgres -c 'create database rsgb'
  - psql -U postgres --list
  # set up RSGB
  - psql -U postgres -d rsgb -c 'create extension postgis'
  - psql -U postgres -d rsgb -f ./datamodel/generated_scripts/datamodel_postgresql.sql --single-transaction --echo-all
  # - psql -f ./datamodel/utility_scripts/111a_update_gemeente_geom.sql -U postgres -d rsgb --single-transaction
  # - psql -f ./datamodel/utility_scripts/113a_update_wijk_geom.sql -U postgres -d rsgb --single-transaction

install:
  # install all dependencies + artifacts without any testing
  - mvn install -Dmaven.test.skip=true -B -V -fae -q

before_script:
  # dit dient na afloop van de 'install' gedaan te worden omdat de staging DB sql gegenereerd wordt door Hibernate
  - psql -U postgres -d staging -f ./brmo-persistence/target/ddlscripts/create-brmo-persistence-postgresql.sql --single-transaction
  - psql -U postgres -d staging -f ./brmo-persistence/db/01_create_indexes.sql
  - psql -U postgres -d staging -f ./brmo-persistence/db/02_insert_default_user.sql
  - psql -U postgres -d staging -f ./brmo-persistence/db/03_update_status_enum_value.sql

# run tests
script:
  # run unit tests
  - mvn -e test -B
  # run integration tests
  - mvn -e verify -B

after_success:

after_failure:

after_script:

notifications:
  email: false
  #  on_success: [always|never|change] # default: change
  #  on_failure: [always|never|change] # default: always

正如您在日志中看到的那样,它只是在几次psql调用后停止。

0.01s$ psql --version
psql (PostgreSQL) 9.3.5
before_install.2
0.02s$ psql -U postgres -c 'create database staging'
CREATE DATABASE
before_install.3
0.22s$ psql -U postgres -c 'create database rsgb'
CREATE DATABASE
before_install.4
1.04s$ psql -U postgres -d rsgb -c 'create extension postgis'
CREATE EXTENSION
$ psql -U postgres --list
                                  List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
-----------+----------+----------+-------------+-------------+-----------------------
 postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 rsgb      | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 staging   | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
 travis    | travis   | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
(6 rows)
(END)
No output has been received in the last 10 minutes, this potentially indicates a stalled build or something wrong with the build itself.
The build has been terminated

1 个答案:

答案 0 :(得分:1)

我花了大约3个小时来解决同样的问题,一旦你理解了原因,问题就很简单了。 psql只是试图分页输出。有多种方法可以禁用寻呼机,但我使用的解决方案是在PAGER=cat中设置.travis.yml环境变量,如下所示:

env: - PGUSER=postgres PAGER=cat