用phoenix + heroku设置travis ci

ker*_*lin 5 postgresql heroku travis-ci phoenix-framework

我遇到了使用Travis CI自动部署到我的Phoenix应用程序的Heroku的问题.这是Travis CI构建错误:

(Mix) The database for AgilePulse.Repo couldn't be created: tcp connect: connection refused - :econnrefused
Run Code Online (Sandbox Code Playgroud)

这是我的.travis.yml配置:

language: elixir
elixir:
  - 1.3.2
otp_release:
  - 19.0
sudo: false
addons:
  postgresql: '9.5'
notifications:
  email: false
env:
  - MIX_ENV=test
before_script:
  - cp config/travis_ci_test.exs config/test.secret.exs
  - mix do ecto.create, ecto.migrate
Run Code Online (Sandbox Code Playgroud)

这是我的travis_ci_test.exs:

use Mix.Config

# Configure your database
config :agile_pulse, AgilePulse.Repo,
  adapter: Ecto.Adapters.Postgres,
  username: "postgres",
  password: "",
  database: "travis_ci_test",
  hostname: "localhost",
  pool: Ecto.Adapters.SQL.Sandbox
Run Code Online (Sandbox Code Playgroud)

任何指针将不胜感激!

附加信息:

Svi*_*len 4

再看一遍:从您发布的 travis 日志来看,看起来您正在12.04为您的构建引导 Ubuntu Precise;我怀疑 Postgres9.5不适用于precise

https://docs.travis-ci.com/user/database-setup/#Using-a- different-PostgreSQL-Version

您能尝试切换到 Postgres9.4看看是否有效吗?