From 3894abe211c803fa1a50840a92824e92aa31497e Mon Sep 17 00:00:00 2001 From: Luis Rascao Date: Sun, 30 Oct 2016 00:45:54 +0100 Subject: Provide per-command command line help --- priv/templates/extended_bin | 62 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) (limited to 'priv/templates/extended_bin') diff --git a/priv/templates/extended_bin b/priv/templates/extended_bin index 0881a08..63a46d1 100755 --- a/priv/templates/extended_bin +++ b/priv/templates/extended_bin @@ -31,6 +31,57 @@ REL_DIR="$RELEASE_ROOT_DIR/releases/$REL_VSN" ERL_OPTS="{{ erl_opts }}" RUNNER_LOG_DIR="${RUNNER_LOG_DIR:-$RELEASE_ROOT_DIR/log}" +relx_usage() { + command="$1" + + case "$command" in + unpack) + echo "Usage: $REL_NAME unpack [VERSION]" + echo "Unpacks a release package VERSION, it assumes that this" + echo "release package tarball has already been deployed at one" + echo "of the following locations:" + echo " releases/-.tar.gz" + echo " releases//-.tar.gz" + echo " releases//.tar.gz" + ;; + install) + echo "Usage: $REL_NAME install [VERSION]" + echo "Installs a release package VERSION, it assumes that this" + echo "release package tarball has already been deployed at one" + echo "of the following locations:" + echo " releases/-.tar.gz" + echo " releases//-.tar.gz" + echo " releases//.tar.gz" + ;; + uninstall) + echo "Usage: $REL_NAME uninstall [VERSION]" + echo "Uninstalls a release VERSION, it will only accept" + echo "versions that are not currently in use" + ;; + upgrade) + echo "Usage: $REL_NAME upgrade [VERSION]" + echo "Upgrades the currently running release to VERSION, it assumes" + echo "that a release package tarball has already been deployed at one" + echo "of the following locations:" + echo " releases/-.tar.gz" + echo " releases//-.tar.gz" + echo " releases//.tar.gz" + ;; + downgrade) + echo "Usage: $REL_NAME downgrade [VERSION]" + echo "Downgrade the currently running release to VERSION, it assumes" + echo "that a release package tarball has already been deployed at one" + echo "of the following locations:" + echo " releases/-.tar.gz" + echo " releases//-.tar.gz" + echo " releases//.tar.gz" + ;; + *) + echo "Usage: $REL_NAME {start|start_boot |foreground|stop|restart|reboot|pid|ping|console|console_clean|console_boot |attach|remote_console|upgrade|downgrade|install|uninstall|versions|escript|rpc|rpcterms|eval}" + ;; + esac +} + find_erts_dir() { __erts_dir="$RELEASE_ROOT_DIR/erts-$ERTS_VSN" if [ -d "$__erts_dir" ]; then @@ -460,8 +511,17 @@ case "$1" in shift relx_nodetool "eval" $@ ;; + help) + if [ -z "$2" ]; then + relx_usage + exit 1 + fi + + TOPIC="$2"; shift + relx_usage $TOPIC + ;; *) - echo "Usage: $REL_NAME {start|start_boot |foreground|stop|restart|reboot|pid|ping|console|console_clean|console_boot |attach|remote_console|upgrade|downgrade|install|uninstall|versions|escript|rpc|rpcterms|eval}" + relx_usage exit 1 ;; esac -- cgit v1.2.3 From fc3d783511dde534f6f07c24067106126f1053b1 Mon Sep 17 00:00:00 2001 From: Luis Rascao Date: Sun, 30 Oct 2016 14:26:06 +0000 Subject: Allow optionally setting a release as permanent after relup Support a command line argument to the `upgrade`/`downgrade` commands: `--no-permanent`, if this is set the release will be unpacked, installed and be made current but not permanent, when the user is confortable with the outcomehe can issue the same command a second time without the `--no-permanent` option. --- priv/templates/extended_bin | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'priv/templates/extended_bin') diff --git a/priv/templates/extended_bin b/priv/templates/extended_bin index 63a46d1..5cb1c04 100755 --- a/priv/templates/extended_bin +++ b/priv/templates/extended_bin @@ -52,6 +52,9 @@ relx_usage() { echo " releases/-.tar.gz" echo " releases//-.tar.gz" echo " releases//.tar.gz" + echo "" + echo " --no-permanent Install release package VERSION but" + echo " don't make it permanent" ;; uninstall) echo "Usage: $REL_NAME uninstall [VERSION]" @@ -66,15 +69,21 @@ relx_usage() { echo " releases/-.tar.gz" echo " releases//-.tar.gz" echo " releases//.tar.gz" + echo "" + echo " --no-permanent Install release package VERSION but" + echo " don't make it permanent" ;; downgrade) echo "Usage: $REL_NAME downgrade [VERSION]" - echo "Downgrade the currently running release to VERSION, it assumes" + echo "Downgrades the currently running release to VERSION, it assumes" echo "that a release package tarball has already been deployed at one" echo "of the following locations:" echo " releases/-.tar.gz" echo " releases//-.tar.gz" echo " releases//.tar.gz" + echo "" + echo " --no-permanent Install release package VERSION but" + echo " don't make it permanent" ;; *) echo "Usage: $REL_NAME {start|start_boot |foreground|stop|restart|reboot|pid|ping|console|console_clean|console_boot |attach|remote_console|upgrade|downgrade|install|uninstall|versions|escript|rpc|rpcterms|eval}" -- cgit v1.2.3