Packages

Help you bottle, ship and serve your Elixir apps. Bottler is a collection of tools that aims to help you generate releases, ship them to your servers, install them there, and get them live on production.

Current section

Files

Jump to
bottler lib mix tasks bottler.ex
Raw

lib/mix/tasks/bottler.ex

require Bottler.Helpers, as: H
alias Bottler, as: B
defmodule Mix.Tasks.Deploy do
@moduledoc """
Build a release file, ship it to remote servers, install it, and restart
the app. No hot code swap for now.
Use like `mix deploy`.
`prod` environment is used by default. Use like
`MIX_ENV=other_env mix deploy` to force it to `other_env`.
"""
use Mix.Task
def run(_args) do
H.set_prod_environment
c = H.read_and_validate_config
:ok = B.release c
{:ok, _} = B.ship c
{:ok, _} = B.install c
{:ok, _} = B.restart c
:ok
end
end
defmodule Mix.Tasks.Release do
@moduledoc """
Build a release file. Use like `mix release`.
`prod` environment is used by default. Use like
`MIX_ENV=other_env mix release` to force it to `other_env`.
"""
use Mix.Task
def run(_args) do
H.set_prod_environment
c = H.read_and_validate_config
:ok = B.release c
:ok
end
end