Configuring travis ci with phoenix + heroku

I'm having problems automating deployments with Travis CI in Heroku for my Phoenix application. Here's the Travis CI build error:

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

Here is my .travis.ymlconfig:

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

Here's mine 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

Any pointers would be greatly appreciated!

Additional Information:

+4
source share
1 answer

At a second glance: judging by the travis magazine you posted, it looks like you're downloading Ubuntu 12.04Precise for your build; I suspect Postgres is 9.5not available on precise:

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

Postgres 9.4 , ?

+4

Source: https://habr.com/ru/post/1654237/


All Articles