![Lisa Simpson](

Fast, simple, and composable deployment library for Elixir.

## Installation

Just add `relisa` to your project dependencies:

def deps do
  [{:relisa, github: "SenecaSystems/relisa"}]

### Configuration

To get started, run `mix relisa.init` in the root directory of your project.


This will create a `config/relisa.exs` file for all of your relisa-specific configuration.
Here is an example of what one looks like:

use Mix.Config

config :relisa,
  # Targets are specified with an {address, ssh_key_path} tuple
  targets: [
    {"ubuntu@", "/vagrant/deploy.pem"}
  # Hooks are Mix tasks that will be executed at certain life-cycle moments
  # in Relisa
  hooks: [
    pre: ["phoenix.digest"]

Relisa uses [ssh]( and [scp]( to connect with your servers. Each `target` should specify an address (`username@ip_address_or_hostname`) and the path to an ssh key for that server.

## Usage

### Prepare a release

To ready your application for production, simply run `mix relisa.prepare`. Relisa prefers [Semantic Versioning]( and you can include the `--major`, `--minor`, or `--patch` flags to specify how your version should be bumped. The default is `--patch`.

![major prepare](

Since Relisa automatically updates your version for you, you should commit the changes.

### Deploy release

All you have to do is `MIX_ENV=prod mix relisa.deploy` and relax. Relisa will run any hooks before deploying, package up your release, transport it to each of the `targets` specified in your configuration, and start the application.

Note that you need to do this step on the same arch as your target. We use [Vagrant]( to make this a snap. See [this gist]( for the `Vagrantfile` we use.


### Upgrade

If Relisa detects that your application is already running, it will update the running application to the latest version. This utilizes hot-code reloading for zero-downtime deployments and upgrades.

![upgrade a running app](

### Rollback

If your deployment had a bug and you'd like to roll back, that's not a problem. `mix relisa.rollback 1.0.0` (where `1.0.0` is the version you'd like to roll back to) and you're good to go.

![rolling back a deploy](

## Hooks

Relisa is meant to be incredibly light-weight so you only load the tools you need. It can run mix tasks before a deployment as specified in the `:hooks` configuration option. From digesting assets to commiting and pushing version changes, Relisa is incredibly extendable.