{"_id":"55bf8ff483675d17000b9b2c","link_url":"","hidden":false,"excerpt":"How to get up and running with releases","slug":"getting-started","title":"Getting Started","__v":0,"updates":[],"createdAt":"2015-06-23T19:34:09.845Z","type":"basic","version":"55bf8ff383675d17000b9b2a","body":"This project's goal is to make releases with Elixir projects a breeze. It is composed of a mix task, and build files required to successfully take your Elixir project and perform a release build, and a [simplified configuration mechanism](https://github.com/bitwalker/conform) which integrates with your current configuration and makes it easy for your operations group to configure the release once deployed. All you have to do to get started is the following:\n\nStart by adding exrm as a dependency to your project:\n\n```elixir\n defp deps do\n [{:exrm, \"~> 0.18.1\"}]\n end\n```\n\n### Usage\n\nYou can build a release with the `release` task:\n\n```\n$ mix release\n````\n\nThis task constructs the complete release for you. The output is sent to `rel/<project>`. To see what flags you can pass to this task, use `mix help release`.\n\nYou can start a console connected to the release build of your application with:\n\n```\n$ rel/<project>/bin/<project> console\n```\n\n### Testing a release during development\n\nRather than having to build a release, deploy, then test, you can actually test your release during development by using `mix release --dev`.\n\nThis symlinks your application's code into the release, allowing you to make code changes, then recompile and restart your release to see the changes. Being able to rapidly test and tweak your release like this goes a long way to making the release process less tedious!\n\n### Cleanup\n\nYou can clean up release artifacts produced by exrm with:\n\n```\n$ mix release.clean\n```\n\nThis will clean up any temporary artifacts related to the current version, and allow you to effectively start a release build from scratch.\n\nBy passing the `--implode` flag, you can further extend the clean up to *all* release related artifacts, effectively resetting yourself to a pre-exrm state. This should be done carefully, as anything related to releases will be removed!\n\nYou can pass the `--no-confirm` flag in addition to `--implode` if you want to bypass exrm's warning about removing all artifacts (this is primarily for automated tasks, but might come in useful during testing scenarios)\n\n### **IMPORTANT**\n\nIt is currently not supported to perform hot upgrades/downgrades from the `rel` directory. This is because the upgrade/downgrade process deletes files from the release when it is installed, which will cause issues when you are attempting to build a release of the next version of your app. It is important that you do actual deployments of your app outside of the build directory!","order":0,"category":"55bf8ff483675d17000b9b2b","project":"5589b4b0db0a020d00a75f8a","user":"5589b346986b6c0d00f54355","link_external":false,"githubsync":"","sync_unique":"","api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"childrenPages":[]}

Documentation

Getting Started

How to get up and running with releases

This project's goal is to make releases with Elixir projects a breeze. It is composed of a mix task, and build files required to successfully take your Elixir project and perform a release build, and a [simplified configuration mechanism](https://github.com/bitwalker/conform) which integrates with your current configuration and makes it easy for your operations group to configure the release once deployed. All you have to do to get started is the following:
Start by adding exrm as a dependency to your project:
```elixir
defp deps do
[{:exrm, "~> 0.18.1"}]
end
```
### Usage
You can build a release with the `release` task:
```
$ mix release
````
This task constructs the complete release for you. The output is sent to `rel/<project>`. To see what flags you can pass to this task, use `mix help release`.
You can start a console connected to the release build of your application with:
```
$ rel/<project>/bin/<project> console
```
### Testing a release during development
Rather than having to build a release, deploy, then test, you can actually test your release during development by using `mix release --dev`.
This symlinks your application's code into the release, allowing you to make code changes, then recompile and restart your release to see the changes. Being able to rapidly test and tweak your release like this goes a long way to making the release process less tedious!
### Cleanup
You can clean up release artifacts produced by exrm with:
```
$ mix release.clean
```
This will clean up any temporary artifacts related to the current version, and allow you to effectively start a release build from scratch.
By passing the `--implode` flag, you can further extend the clean up to *all* release related artifacts, effectively resetting yourself to a pre-exrm state. This should be done carefully, as anything related to releases will be removed!
You can pass the `--no-confirm` flag in addition to `--implode` if you want to bypass exrm's warning about removing all artifacts (this is primarily for automated tasks, but might come in useful during testing scenarios)
### **IMPORTANT**
It is currently not supported to perform hot upgrades/downgrades from the `rel` directory. This is because the upgrade/downgrade process deletes files from the release when it is installed, which will cause issues when you are attempting to build a release of the next version of your app. It is important that you do actual deployments of your app outside of the build directory!