From 2aed5cd94850eae1c11b7add58db99d70eaec5ad 2023-11-29 10:45:09 From: RhodeCode Admin Date: 2023-11-29 10:45:09 Subject: [PATCH] feat(status): added -v flag to print some useful info on the stack status --- diff --git a/scripts/rcstack/rcstack b/scripts/rcstack/rcstack index 1de1d04..710993c 100755 --- a/scripts/rcstack/rcstack +++ b/scripts/rcstack/rcstack @@ -599,6 +599,11 @@ rcstack_stack_status_usage() { printf " Display a detailed info about configuration files\n" echo + # :flag.usage + printf " %s\n" "-v" + printf " Verbose output for details on the stack\n" + echo + # :command.usage_fixed_flags printf " %s\n" "--help, -h" printf " Show this help\n" @@ -3236,11 +3241,24 @@ rcstack_stack_status_command() { DEBUG=${args[--debug]} DETAILED=${args[--detailed]} CONFIGS=${args[--configs]} + VERBOSE=${args[-v]} .env --file $RUNTIME_ENV .env get RC_APP_BASE_URL RC_APP_BASE_URL=$REPLY + .env get RC_VERSION + RC_VERSION=$REPLY + + .env get RC_SSH_PORT + RC_SSH_PORT=$REPLY + + .env get RC_EDITION + RC_EDITION=$REPLY + + .env get RC_LICENSE_TOKEN + RC_LICENSE_TOKEN=$REPLY + if [[ $DEBUG ]]; then echo "---" ps_cmd=$(docker ps --filter=name=rc_cluster --format="{{.ID}}") @@ -3258,6 +3276,12 @@ rcstack_stack_status_command() { fi echo "Running hostname: $RC_APP_BASE_URL" + if [[ $VERBOSE ]]; then + printf "Edition: $RC_EDITION:$RC_VERSION\n" + printf "License: $RC_LICENSE_TOKEN\n" + printf "SSH Port: $RC_SSH_PORT\n" + printf "\n" + fi if [[ $CONFIGS ]]; then printf "RhodeCode:\n" @@ -3591,7 +3615,7 @@ rcstack_cli_cmd_command() { vcsserver" if [[ $DEBUG ]]; then - echo $CMD_RHODECODE + echo $CMD_RHODECODE echo ${other_args[*]} fi @@ -5283,6 +5307,14 @@ rcstack_stack_status_parse_requirements() { shift ;; + # :flag.case + -v) + + # :flag.case_no_arg + args['-v']=1 + shift + ;; + -?*) printf "invalid option: %s\n" "$key" >&2 exit 1 @@ -5971,6 +6003,9 @@ rcstack_cli_cmd_parse_requirements() { esac done + # :command.default_assignments + [[ -n ${args['--env-file-path']:-} ]] || args['--env-file-path']="$PWD/.custom/.runtime.env" + } # :command.parse_requirements