diff options
author | Luis Rascao <[email protected]> | 2016-09-05 22:24:40 +0100 |
---|---|---|
committer | Luis Rascao <[email protected]> | 2016-10-29 23:43:00 +0100 |
commit | a3bffcaf8eaddc7b316ba2669177f9d40979b254 (patch) | |
tree | 5f8b7545953497626685357ce36424ce17d21b18 /priv/templates/extended_bin | |
parent | cb154f3a54c90000eae9fd582304872eec9db54e (diff) | |
download | relx-a3bffcaf8eaddc7b316ba2669177f9d40979b254.tar.gz relx-a3bffcaf8eaddc7b316ba2669177f9d40979b254.tar.bz2 relx-a3bffcaf8eaddc7b316ba2669177f9d40979b254.zip |
Allow for a more flexible relup package location
Instead of forcing the user to put the tarball package
with the expected name (<relname>.tar.gz)and in the
expected location (releases/<version>) symlink this
fixed file name to a tarball existing in one of three different
places (releases/, releases/<version>,
releases/<version>/<relname>.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.
Diffstat (limited to 'priv/templates/extended_bin')
-rwxr-xr-x | priv/templates/extended_bin | 19 |
1 files changed, 8 insertions, 11 deletions
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) |