Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmcconnell committed Mar 16, 2022
1 parent b4f9531 commit 26f9dc1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

Generate an Elixir [release](https://hexdocs.pm/mix/Mix.Tasks.Release.html) with a **binary executable** launcher, instead of batch/shell scripts.

`Relexe` uses [Burrito](https://github.com/burrito-elixir/burrito) with a modified build phase. Relexe's build phase uses Zig to build an executable launcher with a user-specified CLI.
`Relexe` uses [Burrito](https://github.com/burrito-elixir/burrito) with a modified build phase thate uses Zig to build an executable launcher with a user-specified CLI.

## Usage

Expand Down Expand Up @@ -66,7 +66,7 @@ The `help` for this example would be:

```
USAGE:
bananas [COMMAND]
bananas.exe [COMMAND]
COMMANDS:
start Start bananas (default)
Expand All @@ -83,7 +83,7 @@ HELP:
Running `bananas create-admin` would prompt the user for the `username` and `password` ...

```
> bananas create-admin
> bananas.exe create-admin
username: Eric
password: BananaMan
```
Expand Down Expand Up @@ -112,7 +112,7 @@ The Windows Service controls are managed through the release executable. In a `

### `eval` and `rpc` Commands

`eval` and `rpc` commands are defined as a three-element keyword list with a `name`, `help` string and `eval` or `rpc` command. The command can be either a straight function call, e.g. `Bananas.Release.migrate()`, or a `{Module, :function, [arg_names]}` tuple, e.g. `{Bananas.Release, :create_admin, [:username, :password]}`. An MFA command will prompt the user for each argument value. It is not feasible to handle args on the command line in Windows.
`eval` and `rpc` commands are defined as a three-element keyword list with a `name`, `help` string and `eval` or `rpc` command. The command can be either a straight function call, e.g. `Bananas.Release.migrate()`, or a `{Module, :function, [arg_names]}` tuple, e.g. `{Bananas.Release, :create_admin, [:username, :password]}`. An MFA command will prompt the user for each argument value, as it is not feasible to handle args on the command line in Windows.

```elixir
# Function call
Expand All @@ -132,7 +132,7 @@ The Windows Service controls are managed through the release executable. In a `

## Environment Variables

The environment variables that you define are written to `<app>/releases/<version>/.env` and/or `<app>/releases/<version>/.env.<command>`. They are defined per `target` and can be configured in either by setting the `env` option under `relexe` or by creating a `/rel/relexe/.env.<target>[.command].eex` file. If both exist, those defined in the options take precendence, i.e. overwrite the `EEx` template output.
The environment variables that you define are written to `<app>/releases/<version>/.env` and/or `<app>/releases/<version>/.env.<command>`. They are defined per `target` and can be configured either by setting the `relexe[:env]` option in your release config or by creating a `/rel/relexe/.env.<target>[.command].eex` file. If both exist, the options take precendence.

### `env` Option

Expand Down Expand Up @@ -178,7 +178,7 @@ RELEASE_NODE=banana_sales

### EEx Template

Environment variables can also be specified by way of an `EEx` template. Template files shall be created in `/rel/relexe` and be named `.env.<target>.eex` or `.env.<target>.<command>.eex`, where `target` is `windows`, `linux` or `darwin` (TODO: or is it `macos`?) and `command` is the name of the command that these environment variables are for.
Environment variables can also be specified by way of an `EEx` template. Template files shall be created in `/rel/relexe` and be named `.env.<target>.eex` or `.env.<target>.<command>.eex`, where `<target>` is `windows`, `linux` or `darwin` (TODO: or is it `macos`?) and `<command>` is the name of the command that these environment variables are for.

For example, to recreate the Mix Release `daemon` environment variables, we create a `/rel/relexe/.env.linux.daemon.eex`.

Expand All @@ -189,10 +189,6 @@ ELIXIR_ERL_OPTIONS="-heart"

**TODO: I'm not sure if this actually works, as I don't deploy to linux/macos. Please let me know if it doesn't :)**

## `vm.args`

TODO

## Disabling EMPD

TODO
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ defmodule Relexe.MixProject do
package: [
links: %{
"GitHub" => @source_url,
"Zig" => "https://ziglang.org",
"Burrito" => "https://github.com/burrito-elixir/burrito"
},
licenses: ["MIT"]
Expand All @@ -36,7 +35,8 @@ defmodule Relexe.MixProject do

defp deps do
[
{:burrito, github: "burrito-elixir/burrito"}
{:burrito, github: "burrito-elixir/burrito"},
{:ex_doc, "~> 0.28", only: :dev, runtime: false}
]
end
end
6 changes: 6 additions & 0 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
%{
"burrito": {:git, "https://github.com/burrito-elixir/burrito.git", "8f25957ccb15073c876c1797a9315902effb05c5", []},
"castore": {:hex, :castore, "0.1.14", "3f6d7c7c1574c402fef29559d3f1a7389ba3524bc6a090a5e9e6abc3af65dcca", [:mix], [], "hexpm", "b34af542eadb727e6c8b37fdf73e18b2e02eb483a4ea0b52fd500bc23f052b7b"},
"earmark_parser": {:hex, :earmark_parser, "1.4.23", "1d5f22a2802160fd454404fbf5e8f5d14cd8eb727c63701397b72d8c35267e69", [:mix], [], "hexpm", "2ec13bf14b2f4bbb4a15480970e295eede8bb01087fad6ceca27b724ab8e9d18"},
"ex_doc": {:hex, :ex_doc, "0.28.2", "e031c7d1a9fc40959da7bf89e2dc269ddc5de631f9bd0e326cbddf7d8085a9da", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "51ee866993ffbd0e41c084a7677c570d0fc50cb85c6b5e76f8d936d9587fa719"},
"finch": {:hex, :finch, "0.9.1", "ab2b0151ba88543e221cb50bf0734860db55e8748816ee16e4997fe205f7b315", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: false]}, {:mint, "~> 1.3", [hex: :mint, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 0.2", [hex: :nimble_pool, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "6d6b898a59d19f84958eaffec40580f5a9ff88a31e93156707fa8b1d552aa425"},
"jason": {:hex, :jason, "1.3.0", "fa6b82a934feb176263ad2df0dbd91bf633d4a46ebfdffea0c8ae82953714946", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "53fc1f51255390e0ec7e50f9cb41e751c260d065dcba2bf0d08dc51a4002c2ac"},
"makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"},
"makeup_elixir": {:hex, :makeup_elixir, "0.16.0", "f8c570a0d33f8039513fbccaf7108c5d750f47d8defd44088371191b76492b0b", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "28b2cbdc13960a46ae9a8858c4bebdec3c9a6d7b4b9e7f4ed1502f8159f338e7"},
"makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"},
"mime": {:hex, :mime, "2.0.2", "0b9e1a4c840eafb68d820b0e2158ef5c49385d17fb36855ac6e7e087d4b1dcc5", [:mix], [], "hexpm", "e6a3f76b4c277739e36c2e21a2c640778ba4c3846189d5ab19f97f126df5f9b7"},
"mint": {:hex, :mint, "1.4.0", "cd7d2451b201fc8e4a8fd86257fb3878d9e3752899eb67b0c5b25b180bde1212", [:mix], [{:castore, "~> 0.1.0", [hex: :castore, repo: "hexpm", optional: true]}], "hexpm", "10a99e144b815cbf8522dccbc8199d15802440fc7a64d67b6853adb6fa170217"},
"nimble_options": {:hex, :nimble_options, "0.4.0", "c89babbab52221a24b8d1ff9e7d838be70f0d871be823165c94dd3418eea728f", [:mix], [], "hexpm", "e6701c1af326a11eea9634a3b1c62b475339ace9456c1a23ec3bc9a847bca02d"},
"nimble_parsec": {:hex, :nimble_parsec, "1.2.3", "244836e6e3f1200c7f30cb56733fd808744eca61fd182f731eac4af635cc6d0b", [:mix], [], "hexpm", "c8d789e39b9131acf7b99291e93dae60ab48ef14a7ee9d58c6964f59efb570b0"},
"nimble_pool": {:hex, :nimble_pool, "0.2.4", "1db8e9f8a53d967d595e0b32a17030cdb6c0dc4a451b8ac787bf601d3f7704c3", [:mix], [], "hexpm", "367e8071e137b787764e6a9992ccb57b276dc2282535f767a07d881951ebeac6"},
"req": {:hex, :req, "0.2.1", "5d4ee7bc6666cd4d77e95f89ce75ca0ca73b6a25eeebbe2e7bc60cdd56d73865", [:mix], [{:finch, "~> 0.9.1", [hex: :finch, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mime, "~> 1.6 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:nimble_csv, "~> 1.0", [hex: :nimble_csv, repo: "hexpm", optional: true]}], "hexpm", "ababd5c8a334848bde2bc3c2f518df22211c8533d863d15bfefa04796abc3633"},
"telemetry": {:hex, :telemetry, "1.0.0", "0f453a102cdf13d506b7c0ab158324c337c41f1cc7548f0bc0e130bbf0ae9452", [:rebar3], [], "hexpm", "73bc09fa59b4a0284efb4624335583c528e07ec9ae76aca96ea0673850aec57a"},
Expand Down

0 comments on commit 26f9dc1

Please sign in to comment.