Skip to content

Commit

Permalink
Move some exports to main release script. Fixes #563
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwalker committed Jan 18, 2019
1 parent b6f6bc7 commit 5add0c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 0 additions & 7 deletions priv/templates/release_rc_exec.eex
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,12 @@ RELEASE_ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
RELEASES_DIR="${RELEASE_ROOT_DIR}/releases"
REL_NAME="${REL_NAME:-<%= release_name %>}"
REL_VSN="${REL_VSN:-$(cut -d' ' -f2 "${RELEASES_DIR}"/start_erl.data)}"
ERTS_VSN="${ERTS_VSN:-$(cut -d' ' -f1 "${RELEASES_DIR}"/start_erl.data)}"
<%= if (include_erts == false or is_nil(erts_vsn)) do %>USE_HOST_ERTS=true<% end %>
# The location of consolidated protocol .beams
CONSOLIDATED_DIR="${RELEASE_ROOT_DIR}/lib/${REL_NAME}-${REL_VSN}/consolidated"

export RELEASE_ROOT_DIR
export RELEASES_DIR
export REL_NAME
export REL_VSN
export ERTS_VSN
export USE_HOST_ERTS
export DEBUG_BOOT
export CONSOLIDATED_DIR

# Set DEBUG_BOOT to output verbose debugging info during execution
if [ ! -z "$DEBUG_BOOT" ]; then
Expand Down
5 changes: 5 additions & 0 deletions priv/templates/release_rc_main.eex
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ ERL_OPTS="${ERL_OPTS:-<%= release.profile.erl_opts %>}"
# Environment variables for run_erl
RUN_ERL_ENV="${RUN_ERL_ENV:-<%= release.profile.run_erl_env %>}"
# Current version of ERTS being used
<%= if (include_erts == false or is_nil(erts_vsn)) do %>USE_HOST_ERTS=true<% end %>
# If this is not present/unset, it will be detected
<%= if ((is_binary(include_erts) or include_erts) and not is_nil(erts_vsn)) do %>ERTS_VSN="${ERTS_VSN:-<%= erts_vsn %>}"<% end %>
DISTILLERY_VSN="<%= Application.spec(:distillery, :vsn) %>"
export REL_NAME
export REL_VSN
export ERL_OPTS
export RUN_ERL_ENV
export USE_HOST_ERTS
export ERTS_VSN
export DISTILLERY_VSN

Expand Down Expand Up @@ -74,6 +76,9 @@ RELEASE_ROOT_DIR="${RELEASE_ROOT_DIR:-$(dirname "$(dirname "${SCRIPT_DIR}")")}"
REL_DIR="${REL_DIR:-$RELEASE_ROOT_DIR/releases/$REL_VSN}"
# The location of builtin command scripts
RELEASE_LIBEXEC_DIR="$SCRIPT_DIR/libexec"
# The location of consolidated protocol .beams
CONSOLIDATED_DIR="${RELEASE_ROOT_DIR}/lib/${REL_NAME}-${REL_VSN}/consolidated"
export CONSOLIDATED_DIR

# shellcheck source=../libexec/readlink.sh
. "$RELEASE_LIBEXEC_DIR/readlink.sh"
Expand Down

0 comments on commit 5add0c9

Please sign in to comment.