Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add exports of RELEASE_NAME, RELEASE_VERSION and RELEASE_PROG to script #854

Merged
merged 1 commit into from
Feb 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion priv/templates/bin
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ if [ -z "$SCRIPT" ]; then
fi;
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT")" && pwd -P)"
RELEASE_ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd -P)"
REL_NAME="{{ rel_name }}"
export REL_NAME="{{ rel_name }}"
REL_VSN="{{ rel_vsn }}"

# export these to match mix release environment variables
export RELEASE_NAME="{{ rel_name }}"
export RELEASE_VSN="{{ rel_vsn }}"
export RELEASE_PROG="${SCRIPT}"

ERTS_VSN="{{ erts_vsn }}"
REL_DIR="$RELEASE_ROOT_DIR/releases/$REL_VSN"
ERL_OPTS="{{ erl_opts }}"
Expand Down
5 changes: 5 additions & 0 deletions priv/templates/bin_windows
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ set rel_vsn={{ rel_vsn }}
set erts_vsn={{ erts_vsn }}
set erl_opts={{ erl_opts }}

:: export these to match mix release environment variables
set RELEASE_NAME={{ rel_name }}
set RELEASE_VSN={{ rel_vsn }}
set RELEASE_PROG=%~nx0

:: Set the root release directory based on the location of this batch file
set script_dir=%~dp0
for %%A in ("%script_dir%\..") do (
Expand Down
5 changes: 5 additions & 0 deletions priv/templates/bin_windows_ps
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ $rel_vsn = '{{ rel_vsn }}'
$erts_vsn = '{{ erts_vsn }}'
$erl_opts = '{{ erl_opts }}'

# export these to match mix release environment variables
$RELEASE_NAME = '{{ rel_name }}'
$RELEASE_VERSION = '{{ rel_vsn }}'
$RELEASE_PROG = $MyInvocation.MyCommand.Name

# Ensure we have PSScriptRoot
if (!(Test-Path variable:global:PSScriptRoot)) {
# Support for powershell 2.0
Expand Down
6 changes: 6 additions & 0 deletions priv/templates/extended_bin
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ RELEASE_ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd -P)"
# Make the value available to variable substitution calls below
export REL_NAME="{{ rel_name }}"
REL_VSN="{{ rel_vsn }}"

# export these to match mix release environment variables
export RELEASE_NAME="{{ rel_name }}"
export RELEASE_VSN="{{ rel_vsn }}"
export RELEASE_PROG="${SCRIPT}"

ERTS_VSN="{{ erts_vsn }}"
REL_DIR="$RELEASE_ROOT_DIR/releases/$REL_VSN"
RUNNER_LOG_DIR="${RUNNER_LOG_DIR:-$RELEASE_ROOT_DIR/log}"
Expand Down
5 changes: 5 additions & 0 deletions priv/templates/extended_bin_windows
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ set rel_vsn={{ rel_vsn }}
set erts_vsn={{ erts_vsn }}
set erl_opts={{ erl_opts }}

:: export these to match mix release environment variables
set RELEASE_NAME={{ rel_name }}
set RELEASE_VSN={{ rel_vsn }}
set RELEASE_PROG=%~nx0

:: Make sure `findstr` is accessible
set PATH=%PATH%;%SystemRoot%\System32

Expand Down
5 changes: 5 additions & 0 deletions priv/templates/extended_bin_windows_ps
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ $rel_vsn = '{{ rel_vsn }}'
$erts_vsn = '{{ erts_vsn }}'
$erl_opts = '{{ erl_opts }}'

# export these to match mix release environment variables
$RELEASE_NAME = '{{ rel_name }}'
$RELEASE_VERSION = '{{ rel_vsn }}'
$RELEASE_PROG = $MyInvocation.MyCommand.Name

# Ensure we have PSScriptRoot
if (!(Test-Path variable:global:PSScriptRoot)) {
# Support powershell 2.0
Expand Down