Closed fahadnaeemkhan closed 5 years ago
I have temporary fixed this by adding plugin
in which i'm removing mix
from %Release{}
application list in before_assembly
callback but I still have to add distillery
to the path
$ MIX_ENV=dev elixir -pa _build/dev/lib/distillery/ebin -S mix release
==> Assembling release..
==> Building release testify_ex:0.1.0 using environment dev
==> This is executed just after assembling, and just prior to packaging the release
==> You have set dev_mode to true, skipping archival phase
Release successfully built!
To start the release you have built, you can use one of the following tasks:
# start a shell, like 'iex -S mix'
> _build/dev/rel/testify_ex/bin/testify_ex console
# start in the foreground, like 'mix run --no-halt'
> _build/dev/rel/testify_ex/bin/testify_ex foreground
# start in the background, must be stopped with the 'stop' command
> _build/dev/rel/testify_ex/bin/testify_ex start
If you started a release elsewhere, and wish to connect to it:
# connects a local shell to the running node
> _build/dev/rel/testify_ex/bin/testify_ex remote_console
# connects directly to the running node's console
> _build/dev/rel/testify_ex/bin/testify_ex attach
For a complete listing of commands and their use:
> _build/dev/rel/testify_ex/bin/testify_ex help
plugin code:
defmodule TestifyEx.TestPlugin do
use Mix.Releases.Plugin
def before_assembly(%Release{applications: _} = release, _opts) do
release
|> Map.update!(:applications, &(List.delete(&1, :mix)))
end
def after_assembly(%Release{} = release, _opts) do
info "This is executed just after assembling, and just prior to packaging the release"
release # or nil
end
def before_package(%Release{} = release, _opts) do
info "This is executed just before packaging the release"
release # or nil
end
def after_package(%Release{} = release, _opts) do
info "This is executed just after packaging the release"
release # or nil
end
def after_cleanup(_args, _opts) do
info "This is executed just after running cleanup"
:ok # It doesn't matter what we return here
end
end
This is address in master
Steps to reproduce
just compile distillery 2.0.12
Verbose Logs
Description of issue
2.0.12
Elixir 1.9.0-dev (3680e8535) (compiled with Erlang/OTP 21)
Import all plugins from
rel/plugins
They can then be used by adding
plugin MyPlugin
toeither an environment, or release definition, where
MyPlugin
is the name of the plugin module.~w(rel plugins *.exs) |> Path.join() |> Path.wildcard() |> Enum.map(&Code.eval_file(&1))
use Mix.Releases.Config,
This sets the default release built by
mix release
For a full list of config options for both releases
and environments, visit https://hexdocs.pm/distillery/config/distillery.html
You may define one or more environments in this file,
an environment's settings will override those of a release
when building in that environment, this combination of release
and environment configuration is called a profile
environment :dev do
If you are running Phoenix, you should make sure that
server: true is set and the code reloader is disabled,
even in dev mode.
It is recommended that you build with MIX_ENV=prod and pass
the --env flag to Distillery explicitly if you want to use
dev mode.
set dev_mode: true set include_erts: false set cookie: :")s~|tJgscs:fhCSU.th}~1XOF$4(G>J>h!]]qI[g$BYP_vV~C_8Qj.h(>M>yhz,K" end
environment :prod do set include_erts: true set include_src: false set cookie: :"%QlO$xp1Z`hC[DZa@]>={imBh$8,$W@$,T}~Kb5OOj[S&kW]5b,Gx{W?Xwt^{//;" set vm_args: "rel/vm.args" end
You may define one or more releases in this file.
If you have not set a default release, or selected one
when running
mix release
, the first release in the filewill be used by default
release :testify_ex do set version: "0.1.0" set applications: [ :runtime_tools, tfy_database: :permanent, tfy_resource_manager: :permanent, tfy_rest: :permanent ] end