Skip to content

Commit

Permalink
Address #670 - Improvements to read-only support
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwalker committed May 20, 2019
1 parent 21101b3 commit 4ebfe9a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
3 changes: 3 additions & 0 deletions priv/libexec/erts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ if __info="$(erl -noshell -eval 'io:format("~s~n~s~n", [code:root_dir(), erlang:
ROOTDIR="$(echo "$__info" | head -n1)"
export ERTS_VSN
if [ -z "$ERTS_VSN" ]; then
if [ ! -f "${START_ERL_DATA}" ]; then
fail "Unable to boot release, missing start_erl.data at '"${START_ERL_DATA}"'"
fi
# Update start_erl.data
ERTS_VSN="$(echo "$__info" | tail -n1)"
echo "$ERTS_VSN $REL_VSN" > "$START_ERL_DATA"
Expand Down
12 changes: 11 additions & 1 deletion priv/templates/release_rc_exec.eex
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,23 @@ unset CDPATH
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"
RELEASE_ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
RELEASES_DIR="${RELEASE_ROOT_DIR}/releases"
RELEASE_MUTABLE_DIR="${RELEASE_MUTABLE_DIR:-"${RELEASE_ROOT_DIR}/var"}"
START_ERL_DATA="${RELEASE_MUTABLE_DIR}/start_erl.data"
REL_NAME="${REL_NAME:-<%= release_name %>}"
REL_VSN="${REL_VSN:-$(cut -d' ' -f2 "${RELEASES_DIR}"/start_erl.data)}"
if [ ! -f "${START_ERL_DATA}" ]; then
cp "${RELEASES_DIR}/start_erl.data" "${START_ERL_DATA}"
fi
REL_VSN="${REL_VSN:-$(cut -d' ' -f2 "${START_ERL_DATA}")}"
ERTS_VSN="${ERTS_VSN:-$(cut -d' ' -f1 "${START_ERL_DATA}")}"
<%= if (include_erts == false or is_nil(erts_vsn)) do %>USE_HOST_ERTS=true<% end %>

export RELEASE_ROOT_DIR
export RELEASES_DIR
export RELEASE_MUTABLE_DIR
export START_ERL_DATA
export REL_NAME
export REL_VSN
export ERTS_VSN
export DEBUG_BOOT

# Set DEBUG_BOOT to output verbose debugging info during execution
Expand Down
12 changes: 0 additions & 12 deletions priv/templates/release_rc_main.eex
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,13 @@ fi

unset CDPATH

# Name of the release
REL_NAME="${REL_NAME:-<%= release_name %>}"
# Current version of the release
REL_VSN="${REL_VSN:-<%= release_version %>}"
# Options passed to erl
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

# If readlink has no -f option, or greadlink is not available,
Expand Down
5 changes: 4 additions & 1 deletion priv/templates/release_rc_win_main.ps1.eex
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ if ($Env:RELEASE_MUTABLE_DIR -eq $null) {
# be stored in. defaults to /log in the release root directory
$Env:RUNNER_LOG_DIR = (join-path $Env:RELEASE_MUTABLE_DIR "log")
# Path to start_erl.data
$Env:START_ERL_DATA = (join-path $release_root_dir (join-path "releases" "start_erl.data"))
$Env:START_ERL_DATA = (join-path $Env:RELEASE_MUTABLE_DIR "start_erl.data")
if (-not (test-path $Env:START_ERL_DATA)) {
copy-item -Path (join-path $releases_dir "start_erl.data") -Destination $Env:START_ERL_DATA -Force
}
# Directory containing lifecycle hook scripts
$Env:HOOKS_DIR = (join-path $Env:REL_DIR "hooks")
# Allow override of where to read configuration from
Expand Down

0 comments on commit 4ebfe9a

Please sign in to comment.