忽略 postgresql 的 .travis.yml 版本设置 [英] .travis.yml version setting for postgresql ignored

查看:31
本文介绍了忽略 postgresql 的 .travis.yml 版本设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

my .travis.yml:

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

显然这里有问题,但我不确定如何告诉 Travis 实际使用我指定的 postgres 版本.我遵循了 Travis Docs 中的说明.这似乎是一个错误.

Obviously there's something wrong here but I'm not sure how to tell Travis to actually use the postgres version I specified. I followed the instructions in Travis Docs. This seems like a bug.

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

This is an issue because I'm using the new json column type and therefore getting the following error:

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

推荐答案

我看了一下,您遇到的本质上是我们的 YAML 解析如何处理重复键的错误.我们正在努力解决这个问题.

I took a look and what you're encountering is essentially a bug in how our YAML parsing handles duplicate keys. Fixing how we handle this is something we're working.

您的 .travis.yml 文件中有两个 addons:

You have two addons: keys in your .travis.yml files

  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 内容被丢弃.

What happens is that the last key wins and your postgres stuff is silently discarded.

如果你像下面这样组合它们,它就会如你所愿.

If you combine them like the following, it will work as desired.

<代码>插件:postgres:9.3"代码气候:回购令牌:75408d377a0b3c1ab512bf3fb634617bccf2a1065f8c513e352139427ec8e1fb

请参阅https://github.com/solarce/orientation/commit/8dd4c1c1036259f91c1036592f103659f21d65959和 https://travis-ci.org/solarce/orientation/jobs/83220170 举个例子

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

Please feel free to also reach out to support@travis-ci.com if you have any other questions

这篇关于忽略 postgresql 的 .travis.yml 版本设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆