2015-09-30 35 views
3

随着my .travis.yml如下:.travis.yml版本设置对PostgreSQL忽略

addons: 
    postgresql: "9.3" 
before_script: 
    - psql --version 
    - psql -c 'SELECT version();' -U postgres 

我得到以下输出:

$ 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 

显然有什么东西错在这里,但我不知道怎么样告诉特拉维斯实际使用我指定的postgres版本。我跟着the instructions in Travis Docs。这看起来像一个错误。

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

PG::UndefinedObject: ERROR: type "json" does not exist 

回答

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

的例子,请随时也接触到[email protected]如果您有任何其他疑问

+0

谢谢!现在看起来很明显,但将Slack和关键依赖混合的“addon”声明混合确实感觉很奇怪。 –