bitwalker / distillery

Simplify deployments in Elixir with OTP releases!
MIT License
2.97k stars 398 forks source link

priv folder not in build command ! #552

Closed safwanolaimat closed 6 years ago

safwanolaimat commented 6 years ago

Steps to reproduce

mix new test --umbrella
cd test
#add distillery 2.0 to umbrella deps
cd apps
mix new test
cd ../..
mix deps.get
mix release.init
mkdir apps/test/priv
touch apps/test/example.txt
mix release
ll _build/prod/rel/test/lib/test-0.1.0/

Verbose Logs

Paste the output of the release command you ran with the --verbose flag below in the summary tags (this helps keep the issue easy to navigate):

``` ==> Loading configuration.. ==> Assembling release.. ==> Building release test:0.1.0 using environment prod ==> Discovered applications: > kernel-5.4.3 | | from: /home/safwan/.asdf/installs/erlang/20.3/lib/kernel-5.4.3 | applications: none | includes: none |_____ > artificery-0.2.6 | | from: _build/prod/lib/artificery | applications: | :kernel | :stdlib | :elixir | includes: none |_____ > distillery-2.0.10 | | from: _build/prod/lib/distillery | applications: | :kernel | :stdlib | :elixir | :runtime_tools | :artificery | includes: none |_____ > logger-1.6.6 | | from: /usr/local/lib/elixir/bin/../lib/logger | applications: | :kernel | :stdlib | :elixir | includes: none |_____ > queue-0.1.0 | | from: _build/prod/lib/queue | applications: | :kernel | :stdlib | :elixir | :logger | includes: none |_____ > runtime_tools-1.12.5 | | from: /home/safwan/.asdf/installs/erlang/20.3/lib/runtime_tools-1.12.5 | applications: | :kernel | :stdlib | includes: none |_____ > stdlib-3.4.4 | | from: /home/safwan/.asdf/installs/erlang/20.3/lib/stdlib-3.4.4 | applications: | :kernel | includes: none |_____ > compiler-7.1.5 | | from: /home/safwan/.asdf/installs/erlang/20.3/lib/compiler-7.1.5 | applications: | :kernel | :stdlib | includes: none |_____ > sasl-3.1.1 | | from: /home/safwan/.asdf/installs/erlang/20.3/lib/sasl-3.1.1 | applications: | :kernel | :stdlib | includes: none |_____ > iex-1.6.6 | | from: /usr/local/lib/elixir/bin/../lib/iex | applications: | :kernel | :stdlib | :elixir | includes: none |_____ > mix-1.6.6 | | from: /usr/local/lib/elixir/bin/../lib/mix | applications: | :kernel | :stdlib | :elixir | includes: none |_____ > elixir-1.6.6 | | from: /usr/local/lib/elixir/bin/../lib/elixir | applications: | :kernel | :stdlib | :compiler | includes: none |_____ ==> Running validation checks.. > Mix.Releases.Checks.Erts * PASS > Mix.Releases.Checks.Cookie * PASS > Mix.Releases.Checks.LoadedOrphanedApps * PASS ==> Generated overlay vars: release_name=:test release_version="0.1.0" is_upgrade=false upgrade_from=:latest dev_mode=false include_erts=true include_src=false include_system_libs=true erl_opts="" run_erl_env="" erts_vsn="9.3" output_dir="_build/prod/rel/test" ==> Copying applications to _build/prod/rel/test ==> Generating start_erl.data ==> Generating vm.args ==> Generating sys.config from config/config.exs ==> Including ERTS 9.3 from /home/safwan/.asdf/installs/erlang/20.3/erts-9.3 ==> Generating boot scripts ==> Generating RELEASES ==> Applying overlays ==> Applying mkdir overlay dst: releases/0.1.0/hooks ==> Applying mkdir overlay dst: releases/0.1.0/hooks/pre_configure.d ==> Applying mkdir overlay dst: releases/0.1.0/hooks/post_configure.d ==> Applying mkdir overlay dst: releases/0.1.0/hooks/pre_start.d ==> Applying mkdir overlay dst: releases/0.1.0/hooks/post_start.d ==> Applying mkdir overlay dst: releases/0.1.0/hooks/pre_stop.d ==> Applying mkdir overlay dst: releases/0.1.0/hooks/post_stop.d ==> Applying mkdir overlay dst: releases/0.1.0/hooks/pre_upgrade.d ==> Applying mkdir overlay dst: releases/0.1.0/hooks/post_upgrade.d ==> Applying copy overlay src: _build/prod/lib/distillery/priv/libexec dst: releases/0.1.0/libexec ==> Applying mkdir overlay dst: releases/0.1.0/commands ==> Packaging release.. ==> Archiving test-0.1.0 ==> Writing archive to /home/safwan/Desktop/test/_build/prod/rel/test/releases/0.1.0/test.tar.gz ==> Updating archive.. ==> Including system libs from current Erlang installation ==> Saving archive.. ==> Archive saved! 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/prod/rel/test/bin/test console # start in the foreground, like 'mix run --no-halt' > _build/prod/rel/test/bin/test foreground # start in the background, must be stopped with the 'stop' command > _build/prod/rel/test/bin/test start If you started a release elsewhere, and wish to connect to it: # connects a local shell to the running node > _build/prod/rel/test/bin/test remote_console # connects directly to the running node's console > _build/prod/rel/test/bin/test attach For a complete listing of commands and their use: > _build/prod/rel/test/bin/test help ```

Description of issue

Built with: Elixir 1.6.6 and OTP 19.3

use Mix.Releases.Config, default_release: :default, default_environment: Mix.env()

environment :dev do set dev_mode: true set includeerts: false set cookie: :"8IPZZ0.{:t{M4)y|Dg]2guW_}W(6HD7I}cn&0T[dX@^?<bQ[g`bj%m7q?;I8Mm2" end

environment :prod do set include_erts: true set include_src: false set cookie: :"%Ntfs;uV!3.pWu/@|!99K5apymj;T%ob38HOyog:S.(c6hEs~_GLo}JJ,O9oS7[9" end

release :test do set version: "0.1.0" set applications: [ :runtime_tools, queue: :permanent ] end

bitwalker commented 6 years ago

@safwanolaimat Your steps to reproduce appear to have an error:

First, you create an umbrella, then cd into apps/test to run mix release.init. Then you run mkdir apps/test/priv, but this means the full path you just created (relative to the umbrella root) is apps/test/apps/test/priv, which naturally means that you haven't actually created the priv directory, but another apps directory, which would not be included in the release (without an overlay).

You need (and probably meant) to run cd ../.. after running mix release.init. Also your touch command is missing the priv path, and only creates example.txt in the root of the test app.

safwanolaimat commented 6 years ago

check now

bitwalker commented 6 years ago

@safwanolaimat You still have an issue, touch apps/test/example.txt is not in priv, so example.txt will naturally not end up in the release. I assume you intended to put touch apps/test/priv/example.txt

safwanolaimat commented 6 years ago

@bitwalker yes that what i want to do sorry