Potato

HexBuild Status

Mix tasks to assist in the generation of upgradeable releases.

  • potato.full - Generates a full upgradeable release.
  • potato.upgrade - Generates a minimal upgrade release.

Both of these tasks leverage the work done by the existing mix release task, and this task must be run prior to running potato.

Full releases can be untarred as normal, but an additional preboot.sh script is placed in the versioned release directory, and should be run prior to first system boot if you require that your system support downgrading to this initial release.

Upgrades should be installed via release_handler.

It's not magic. You are still responsible for writing the relevant appup files. I do this via overlays.

Also, see the disclaimer below.

Usage

$ git clone http://example.com/myrepo.git
...
$ cd myrepo
$ git checkout v1.0.0
$ MIX_ENV=prod mix do release, potato.full
...
Generated full release in /home/user/myrepo/_build/prod/rel/myrepo-1.0.0.tar.gz.
$ git checkout v1.0.1
$ MIX_ENV=prod mix do release, potato.full, potato.upgrade --from 1.0.0
...
Generated full release in /home/user/myrepo/_build/prod/rel/myrepo-1.0.1.tar.gz.
Generated upgrade release in /home/user/myrepo/_build/prod/rel/myrepo/releases/myrepo-1.0.1.tar.gz.

Installation

The package can be installed by adding potato to your list of dependencies in mix.exs:

def deps do
  [
    {:potato, "~> 0.1.2", runtime: false}
  ]
end

The docs can be found at https://hexdocs.pm/potato.

Disclaimer

Hacked together and barely tested. Seek alternatives at the first sign of trouble.