忽略postgresql的.travis.yml版本设置

Oli*_*can 5 travis-ci

以下是我的.travis.yml:

addons:
  postgresql: "9.3"
before_script:
  - psql --version
  - psql -c 'SELECT version();' -U postgres
Run Code Online (Sandbox Code Playgroud)

我得到以下输出:

$ psql --version
$ psql (PostgreSQL) 9.4.0
$ psql -c 'SELECT version();' -U postgres

PostgreSQL 9.1.14 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, 64-bit
Run Code Online (Sandbox Code Playgroud)

显然这里有问题,但我不知道如何告诉Travis实际使用我指定的postgres版本.我按照Travis Docs的说明进行操作.这似乎是一个错误.

这是一个问题,因为我使用新的json列类型,因此收到以下错误:

PG::UndefinedObject: ERROR:  type "json" does not exist
Run Code Online (Sandbox Code Playgroud)

sol*_*rce 6

我接过来一看,什么你遇到本质上是一个错误在我们的YAML解析如何处理重复键.解决我们如何处理这个问题是我们正在努力的事情.

addons:.travis.yml文件中有两个键

  1. https://github.com/orientation/orientation/blob/f9850e86a97eff77298f54ce68ca0a07c173e81a/.travis.yml#L6-L7
  2. https://github.com/orientation/orientation/blob/f9850e86a97eff77298f54ce68ca0a07c173e81a/.travis.yml#L39-L41

会发生什么事情是最后一个关键胜利和你的postgres东西被默默地丢弃.

如果您将它们组合如下,它将按预期工作.

addons: postgres: "9.3" code_climate: repo_token: 75408d377a0b3c1ab512bf3fb634617bccf2a1065f8c513e352139427ec8e1fb

有关此示例,请参阅https://github.com/solarce/orientation/commit/8dd4c1c10b8470ff3529af1d6591d619f211354dhttps://travis-ci.org/solarce/orientation/jobs/83220170

如果您有任何其他问题,请随时联系support@travis-ci.com