From a3bffcaf8eaddc7b316ba2669177f9d40979b254 Mon Sep 17 00:00:00 2001 From: Luis Rascao Date: Mon, 5 Sep 2016 22:24:40 +0100 Subject: Allow for a more flexible relup package location Instead of forcing the user to put the tarball package with the expected name (.tar.gz)and in the expected location (releases/) symlink this fixed file name to a tarball existing in one of three different places (releases/, releases/, releases//.tar.gz). Refactor the install/upgrade escript to make it more dynamic, it now runs commands that are passed from the start script while accepting a variable number of arguments. Add a `versions` command to the extended start script that prints out the currently installed versions and their status. --- priv/templates/extended_bin | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'priv/templates/extended_bin') diff --git a/priv/templates/extended_bin b/priv/templates/extended_bin index 2941083..d133570 100755 --- a/priv/templates/extended_bin +++ b/priv/templates/extended_bin @@ -312,13 +312,15 @@ case "$1" in relx_rem_sh ;; - upgrade|downgrade|install) + upgrade|downgrade|install|unpack) if [ -z "$2" ]; then echo "Missing version argument" echo "Usage: $REL_NAME $1 {version}" exit 1 fi + COMMAND="$1"; shift + # Make sure a node IS running if ! relx_nodetool "ping" > /dev/null; then echo "Node is not running!" @@ -326,25 +328,20 @@ case "$1" in fi exec "$BINDIR/escript" "$ROOTDIR/bin/install_upgrade.escript" \ - "install" "$REL_NAME" "$NAME_TYPE" "$NAME" "$COOKIE" "$2" + "$COMMAND" "{'$REL_NAME', \"$NAME_TYPE\", '$NAME', '$COOKIE'}" "$@" ;; - unpack) - if [ -z "$2" ]; then - echo "Missing package argument" - echo "Usage: $REL_NAME $1 {package base name}" - echo "NOTE {package base name} MUST NOT include the .tar.gz suffix" - exit 1 - fi - + versions) # Make sure a node IS running if ! relx_nodetool "ping" > /dev/null; then echo "Node is not running!" exit 1 fi + COMMAND="$1"; shift + exec "$BINDIR/escript" "$ROOTDIR/bin/install_upgrade.escript" \ - "unpack" "$REL_NAME" "$NAME_TYPE" "$NAME" "$COOKIE" "$2" + "versions" "{'$REL_NAME', \"$NAME_TYPE\", '$NAME', '$COOKIE'}" "$@" ;; console|console_clean|console_boot) -- cgit v1.2.3