2015-09-30 45 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」聲明混合確實感覺很奇怪。 –