mirror of
https://gitlab.com/psuapp/psu.git
synced 2024-08-30 18:12:34 +00:00
Ad '--compose-file' flag which deprecates --stack-file flag
This commit is contained in:
parent
8f3aa9b254
commit
13b466d2f4
15
psu
15
psu
@ -33,7 +33,7 @@ main() {
|
||||
"user;-u;--user=USERNAME;Username of the Portainer instance"
|
||||
"password;-p;--password=PASSWORD;Password of the Portainer instance"
|
||||
"name;-n;--name=STACK_NAME;Stack name"
|
||||
"compose-file;-c;--compose-file=[FILE_PATH];Path to docker-compose file (required if action=deploy)"
|
||||
"stack-file;-f;--stack-file=[FILE_PATH];Path to docker-stack file (required if action=deploy)"
|
||||
"env-file;-g;--env-file;Path to file with environment variables to be used by the stack (only used when action=deploy|update)"
|
||||
"endpoint;-e;--endpoint=[ENDPOINT_ID];Which Docker endpoint to use. Defaults to 1"
|
||||
"prune;-r;--prune;Whether to prune unused containers or not (only used when action=deploy). Defaults to false"
|
||||
@ -49,11 +49,12 @@ main() {
|
||||
"version;-V;--version;Display the version of this program"
|
||||
"secure;-s;--secure[=yes|no];DEPRECATED: Use the --insecure option instead. Enable or disable the host's SSL certificate verification. Defaults to 'yes'"
|
||||
"action;-a;--action=[ACTION_NAME];DEPRECATED: Use <action> argument instead. The name of the action to execute"
|
||||
"compose-file;-c;--compose-file=[FILE_PATH];DEPRECATED: Use '--stack-file' option instead. Path to docker-compose file (required if action=deploy)"
|
||||
)
|
||||
|
||||
ACTIONS_TABLE=(
|
||||
# action_name;description[;required_option_key1|required_option_key2...][;optional_option_key1|optional_option_key2...]
|
||||
"deploy;Deploy the stack;url|user|password|name|compose-file;endpoint|env-file|prune|insecure|verbose|debug|strict"
|
||||
"deploy;Deploy the stack;url|user|password|name|stack-file;endpoint|env-file|prune|insecure|verbose|debug|strict"
|
||||
"undeploy;Undeploy/remove the stack;url|user|password|name;endpoint|insecure|verbose|debug|strict"
|
||||
"list;Lists of the stacks already deployed;url|user|password;endpoint|quiet|insecure|verbose|debug|help"
|
||||
"info;Stack information;url|user|password|name;endpoint|quiet|insecure|verbose|debug"
|
||||
@ -396,7 +397,7 @@ set_globals() {
|
||||
check_argument "$PORTAINER_URL" "portainer url" "PORTAINER_URL" "l" "url"
|
||||
fi
|
||||
if [ "$ACTION" == "deploy" ]; then
|
||||
check_argument "$DOCKER_COMPOSE_FILE" "docker compose file" "DOCKER_COMPOSE_FILE" "c" "compose-file"
|
||||
check_argument "$DOCKER_COMPOSE_FILE" "docker stack file" "DOCKER_COMPOSE_FILE" "f" "stack-file"
|
||||
if [ -n "$ENVIRONMENT_VARIABLES_FILE" ] && [[ ! -f "$ENVIRONMENT_VARIABLES_FILE" ]]; then
|
||||
echo_error "Error: File path \"$ENVIRONMENT_VARIABLES_FILE\" not found for \"ENVIRONMENT_VARIABLES_FILE\" environment variable or the \"-g\" flag or the \"--env-file\" option."
|
||||
exit 1
|
||||
@ -438,7 +439,15 @@ inputs() {
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
-f=*|--stack-file=*|-f|--stack-file)
|
||||
DOCKER_COMPOSE_FILE=$(input_option "$1" "$2")
|
||||
if [ -n "$2" ] && [[ ! $2 =~ ^-.+$ ]] ; then
|
||||
# When the second argument is the value of the current option
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
-c=*|--compose-file=*|-c|--compose-file)
|
||||
echo_verbose "DEPRECATED: Use '--stack-file' option, instead of this '$1' option"
|
||||
DOCKER_COMPOSE_FILE=$(input_option "$1" "$2")
|
||||
if [ -n "$2" ] && [[ ! $2 =~ ^-.+$ ]] ; then
|
||||
# When the second argument is the value of the current option
|
||||
|
Loading…
Reference in New Issue
Block a user