Elixir Releases

Elixir Releases

Getting Elxir deployed can be challenging. Especially if you want to do it the Erlang way. This talk provides some guidelines on what to take care of.

84cd9fd20832381fc78084aac4cb4b6c?s=128

Leif Gensert

July 13, 2017
Tweet

Transcript

  1. Elixir Releases

  2. None
  3. The Way /app/*.rb /lib/*.rb Gemfile $ install requirements $ export

    RAILS_ENV=production $ bundle install $ bundle exec rails server
  4. gjaldon/heroku-buildpack-phoenix-static HashNuke/heroku-buildpack-elixir

  5. ?

  6. Build Run $ mix deps.get $ mix release $ _build/app

    start app.tar.gz: - Binaries - Erlang runtime (optional) - Sources (optional)
  7. Watch Out

  8. Build Run $ mix deps.get $ mix release —env=prod $

    _build/app start app.tar.gz
  9. $ docker run image_that_is_like_runtime build.sh

  10. $ _build/app start ** (Postgrex.Error) ERROR 42P01 (undefined_table): relation "users"

    does not exist
  11. $ mix ecto.migrate -bash: mix: command not found

  12. $ _build/app migrate $ _build/app start https://github.com/bitwalker/distillery/blob/master/docs/Running%20Migrations.md

  13. Configuration staging demo testing sandbox production

  14. use Mix.Config config :app, App.Repo, [ database: "app", username: "user",

    password: "supersecret", hostname: “db-server”, port: 5432, ] {'Elixir.QualityControl.Repo', [{database,<<"app">>}, {username,<<“user">>}, {password,<<"supersecret">>}, {hostname,<<“db-server”>>}, {loggers,[]}, {port,5433}]}, config.exs sys.config
  15. use Mix.Config config :app, App.Repo, [ database: "app", username: “user",

    password: System.get_env(“PG_PASS"), hostname: “db-server”, port: 5432, ] config.exs sys.config {'Elixir.QualityControl.Repo', [{database,<<"app">>}, {username,<<“user">>}, {password,nil}, {hostname,<<“db-server”>>}, {loggers,[]}, {port,5433}]},
  16. Replace Variables on Build System {:system, ENV, default} Check In

    Credentials REPLACE_OS_VARS=true Build Config Layer
  17. Why

  18. Because it's cool?

  19. Size 300 MB 50 MB

  20. Resources

  21. Code Reload

  22. Comfortable

  23. Start Early Think About Config Use Distillery