我在使用Travis CI将我的Phoenix应用自动部署到Heroku时遇到了一些问题。下面是Travis CI构建错误信息:
(Mix) The database for AgilePulse.Repo couldn't be created: tcp connect: connection refused - :econnrefused
这是我的.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
这是我的
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
非常感谢您提供任何指针!
附加信息:
pg_isready
调用,以确保它等待服务可用。 - MatheusOl