mirror of
https://github.com/correl/rebar.git
synced 2024-12-03 11:09:57 +00:00
Add slim release support for runner script
This commit is contained in:
parent
fa1a2b53fd
commit
12af16eb70
1 changed files with 37 additions and 8 deletions
|
@ -130,11 +130,42 @@ cd $USE_DIR
|
||||||
# Make sure log directory exists
|
# Make sure log directory exists
|
||||||
mkdir -p $USE_DIR/log
|
mkdir -p $USE_DIR/log
|
||||||
|
|
||||||
# Add ERTS bin dir to our path
|
RUNNER_SCRIPT_DATA=
|
||||||
ERTS_PATH=$RUNNER_BASE_DIR/erts-$ERTS_VSN/bin
|
if [ -e "$RUNNER_BASE_DIR/releases/$APP_VSN/runner_script.data" ]; then
|
||||||
|
RUNNER_SCRIPT_DATA=`cat $RUNNER_BASE_DIR/releases/$APP_VSN/runner_script.data`
|
||||||
|
fi
|
||||||
|
|
||||||
# Setup command to control the node
|
if [ -z "$RUNNER_SCRIPT_DATA" ]; then
|
||||||
NODETOOL="$ERTS_PATH/escript $ERTS_PATH/nodetool $NAME_ARG $COOKIE_ARG"
|
echo "normal release"
|
||||||
|
ROOTDIR=$RUNNER_BASE_DIR
|
||||||
|
ERTS_PATH=$RUNNER_BASE_DIR/erts-$ERTS_VSN/bin
|
||||||
|
NODETOOL="$ERTS_PATH/escript $ERTS_PATH/nodetool $NAME_ARG $COOKIE_ARG"
|
||||||
|
SLIM_ARGS=
|
||||||
|
elif [ "$RUNNER_SCRIPT_DATA" = "slim" ]; then
|
||||||
|
echo "slim release"
|
||||||
|
# Setup system paths
|
||||||
|
SYSTEM_ERL_PATH=`which erl`
|
||||||
|
if [ ! -x "$SYSTEM_ERL_PATH" ]; then
|
||||||
|
echo "Failed to find erl. Is Erlang/OTP available in PATH?"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
SYSTEM_HOME_BIN=${SYSTEM_ERL_PATH%/*}
|
||||||
|
ROOTDIR=$SYSTEM_HOME_BIN/../lib/erlang
|
||||||
|
ERTS_PATH=$ROOTDIR/erts-$ERTS_VSN/bin
|
||||||
|
unset SYSTEM_ERL_PATH
|
||||||
|
unset SYSTEM_HOME_BIN
|
||||||
|
|
||||||
|
# Setup nodetool path. Is it nice to place nodetool script under releases?
|
||||||
|
LOCAL_ERTS_PATH=$RUNNER_BASE_DIR/erts-$ERTS_VSN/bin
|
||||||
|
NODETOOL="$ERTS_PATH/escript $LOCAL_ERTS_PATH/nodetool $NAME_ARG $COOKIE_ARG"
|
||||||
|
unset LOCAL_ERL_PATH
|
||||||
|
|
||||||
|
# Setup additional arguments for slim release
|
||||||
|
SLIM_ARGS="-boot_var RELTOOL_EXT_LIB $RUNNER_BASE_DIR/lib -sasl releases_dir \"$RUNNER_BASE_DIR/releases\""
|
||||||
|
else
|
||||||
|
echo "unknown runner_script.data"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Setup remote shell command to control node
|
# Setup remote shell command to control node
|
||||||
REMSH="$ERTS_PATH/erl -hidden $REMSH_NAME_ARG $REMSH_REMSH_ARG $COOKIE_ARG"
|
REMSH="$ERTS_PATH/erl -hidden $REMSH_NAME_ARG $REMSH_REMSH_ARG $COOKIE_ARG"
|
||||||
|
@ -310,11 +341,10 @@ case "$1" in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
# Setup beam-required vars
|
# Setup beam-required vars
|
||||||
ROOTDIR=$RUNNER_BASE_DIR
|
|
||||||
BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin
|
BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin
|
||||||
EMU=beam
|
EMU=beam
|
||||||
PROGNAME=`echo $0 | sed 's/.*\\///'`
|
PROGNAME=`echo $0 | sed 's/.*\\///'`
|
||||||
CMD="$BINDIR/erlexec -boot $RUNNER_BASE_DIR/releases/$APP_VSN/$BOOTFILE -mode embedded -config $CONFIG_PATH -args_file $VMARGS_PATH"
|
CMD="$BINDIR/erlexec $SLIM_ARGS -boot $RUNNER_BASE_DIR/releases/$APP_VSN/$BOOTFILE -mode embedded -config $CONFIG_PATH -args_file $VMARGS_PATH"
|
||||||
export EMU
|
export EMU
|
||||||
export ROOTDIR
|
export ROOTDIR
|
||||||
export BINDIR
|
export BINDIR
|
||||||
|
@ -339,11 +369,10 @@ case "$1" in
|
||||||
FOREGROUNDOPTIONS="-noinput +Bd"
|
FOREGROUNDOPTIONS="-noinput +Bd"
|
||||||
|
|
||||||
# Setup beam-required vars
|
# Setup beam-required vars
|
||||||
ROOTDIR=$RUNNER_BASE_DIR
|
|
||||||
BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin
|
BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin
|
||||||
EMU=beam
|
EMU=beam
|
||||||
PROGNAME=`echo $0 | sed 's/.*\///'`
|
PROGNAME=`echo $0 | sed 's/.*\///'`
|
||||||
CMD="$BINDIR/erlexec $FOREGROUNDOPTIONS -boot $RUNNER_BASE_DIR/releases/$APP_VSN/$BOOTFILE -config $CONFIG_PATH -args_file $VMARGS_PATH"
|
CMD="$BINDIR/erlexec $SLIM_ARGS $FOREGROUNDOPTIONS -boot $RUNNER_BASE_DIR/releases/$APP_VSN/$BOOTFILE -config $CONFIG_PATH -args_file $VMARGS_PATH"
|
||||||
export EMU
|
export EMU
|
||||||
export ROOTDIR
|
export ROOTDIR
|
||||||
export BINDIR
|
export BINDIR
|
||||||
|
|
Loading…
Reference in a new issue