Commit Graph

412 Commits

Author SHA1 Message Date
Thales Macedo Garitezi a4fd777d77
chore(mix): take into account different release/package/edition types 2021-12-27 09:57:56 -03:00
Thales Macedo Garitezi cc652c3343
ci(mix): add elixir deps check
Checks whether there are discrepancies between rebar3 and mix deps.
2021-12-24 14:44:49 -03:00
Thales Macedo Garitezi 08571f0914
chore(mix): fix: vm.args is actually a template file 2021-12-24 09:59:53 -03:00
Thales Macedo Garitezi 4977921cdb
chore(mix): produce tar and copy more files to release 2021-12-24 09:59:30 -03:00
Thales Macedo Garitezi 4287a8f88d
chore(mix): auto-discover umbrella apps 2021-12-24 08:22:26 -03:00
Thales Macedo Garitezi 67cca5d3a1
chore(mix): use the same script in mix release as in rebar release
Surprisingly enough, by doing small cirurgical changes in the existing
EMQX control scripts, we are able to get it running with Elixir and
with existing functionalities (`console`, `remote_console`, `start`,
`stop`, `ctl`, `foreground`, `eval`).
2021-12-23 17:20:04 -03:00
Thales Macedo Garitezi 238895a301
chore(mix): correctly define release version
With this, we no longer need the last hack in `mix_release.sh`.

A version schema with 3 parts (Major.Minor.Patch) is required by
Elixir:

https://hexdocs.pm/elixir/1.13.1/Version.html#module-versions
2021-12-22 15:43:43 -03:00
Thales Macedo Garitezi 62024854e5
chore(mix): wrap produced script and set required variables
We create a shim script that calls the one produced by Mix Release,
creating and setting the required configurations.
2021-12-22 15:15:19 -03:00
Thales Macedo Garitezi 93d603e336
chore(mix): copy more required files to release
This adds a few more required file copying/templating to the release
build step.
2021-12-22 09:46:40 -03:00
Thales Macedo Garitezi 34d6dbca61
chore(mix): simplify build by using rebar3 for umbrella apps
By treating the apps in the umbrella as dependencies to be managed and
built by rebar3, we can simplify the maintenance of the release, at
the cost of increased build times: using Mix as before, it could track
changed files better than using rebar.  But the complexity and
possibility of discrepancies make it using rebar much more compelling.
2021-12-22 09:40:01 -03:00
Thales Macedo Garitezi 2ff46a6dbb
chore(mix): create a few more required files during release
Since Mix does not support hot upgrades out of the box, it does not
create a `RELEASES` file by default.  Here, we introduce functionality
similar to what `relx` does in order for that file to be generated.

fdc8d7237e/src/rlx_assemble.erl (L928-L948)

The `RELEASES` file, in its turn, is required for `nodetool` to work
properly, and `nodetool` is required for us to generate several
required config files using `hocon`.  Since the `start{_clean}.boot`
file used by the files generated by Elixir must be explicitly defined
in the `RELEASE_LIB` `boot_var`, we apply a small patch in the
existing `nodetool` in order to inject that required parameter when
calling the escript.
2021-12-21 17:28:39 -03:00
Thales Macedo Garitezi 917575de5a
chore(mix): minimal elixir mix release build
This commit enables a minimal working build of EMQX release using
Mix.  However, to properly start the release, several configuration
steps are still missing.  A `mix_release.sh` script does a few hacks
to get the release built with Mix to start properly, by first assuming
that `make emqx` has been run prior to the release, ran once to
generate the `app.*.config` files, and then it copies that and some
other files to the expected places.

Also, `emqx_telemetry` hangs the start procedure because it thinks
it's in an official release and tries to make a request.  We disable
it temporarily via config just to get a working build for now.
2021-12-21 13:51:22 -03:00