diff --git a/docs/container.md b/docs/container.md index a2e2bcb92..1e58f35c0 100644 --- a/docs/container.md +++ b/docs/container.md @@ -531,6 +531,7 @@ FLAGS -p, --project-id= ID or short ID of a project; this flag is optional if a default project is set in the context -q, --quiet suppress process output and only display a machine-readable summary + -s, --stack-id= ID of the stack to operate on -v, --volume=... bind mount a volume to the container --cpus= set CPU limit for the container --create-volumes automatically create named volumes that do not exist @@ -568,6 +569,11 @@ FLAG DESCRIPTIONS This flag controls if you want to see the process output or only a summary. When using mw non-interactively (e.g. in scripts), you can use this flag to easily get the IDs of created resources for further processing. + -s, --stack-id= ID of the stack to operate on + + If omitted, the stack set in the CLI context is used; when that is not set either, the project's default stack is + used. + -v, --volume=... bind mount a volume to the container This flag can be used to add volume mounts to the container. It can be used multiple times to mount multiple diff --git a/docs/stack.md b/docs/stack.md index af18d3b14..961e01cea 100644 --- a/docs/stack.md +++ b/docs/stack.md @@ -3,6 +3,7 @@ Manage container stacks +* [`mw stack create`](#mw-stack-create) * [`mw stack delete [STACK-ID]`](#mw-stack-delete-stack-id) * [`mw stack deploy`](#mw-stack-deploy) * [`mw stack list`](#mw-stack-list) @@ -10,9 +11,78 @@ Manage container stacks * [`mw stack ps`](#mw-stack-ps) * [`mw stack rm [STACK-ID]`](#mw-stack-rm-stack-id) * [`mw stack set-update-schedule STACK-ID SCHEDULE`](#mw-stack-set-update-schedule-stack-id-schedule) +* [`mw stack template install TEMPLATE-ID`](#mw-stack-template-install-template-id) +* [`mw stack template list`](#mw-stack-template-list) +* [`mw stack template ls`](#mw-stack-template-ls) * [`mw stack unset-update-schedule STACK-ID`](#mw-stack-unset-update-schedule-stack-id) * [`mw stack up`](#mw-stack-up) +## `mw stack create` + +Create a new container stack + +``` +USAGE + $ mw stack create -d [--token ] [-p ] [-q] [--input ... --from-template ] + [-c] + +FLAGS + -c, --update-context update the CLI context to use the newly created stack + -d, --description= (required) description of the stack + -p, --project-id= ID or short ID of a project; this flag is optional if a default project is set in the + context + -q, --quiet suppress process output and only display a machine-readable summary + --from-template= ID of a container template to create the stack from + --input=... user input for a template, in 'name=value' format + +AUTHENTICATION FLAGS + --token= API token to use for authentication (overrides environment and config file). NOTE: watch out that + tokens passed via this flag might be logged in your shell history. + +DESCRIPTION + Create a new container stack + + Creates a new, empty container stack, or a stack based on a container template. + + When --from-template is given, the referenced template may define user inputs. These can be supplied non-interactively + with one or more --input flags in 'name=value' format; any required inputs that are neither provided nor have a + default value are prompted for interactively. + + Use "mw stack template list" to discover available templates and their IDs. To add a template to a stack that already + exists, use "mw stack template install" instead. + +EXAMPLES + Create an empty stack + + $ mw stack create --description "my stack" + + Create a stack from a template, providing user inputs + + $ mw stack create --description "my n8n" --from-template --input DOMAIN=example.com --input \ + ADMIN_EMAIL=admin@example.com + +FLAG DESCRIPTIONS + -p, --project-id= ID or short ID of a project; this flag is optional if a default project is set in the context + + May contain a short ID or a full ID of a project; you can also use the "mw context set --project-id=" command + to persistently set a default project for all commands that accept this flag. + + -q, --quiet suppress process output and only display a machine-readable summary + + This flag controls if you want to see the process output or only a summary. When using mw non-interactively (e.g. in + scripts), you can use this flag to easily get the IDs of created resources for further processing. + + --from-template= ID of a container template to create the stack from + + When set, the stack is created from the given container template. Omit this flag to create an empty stack. + + --input=... user input for a template, in 'name=value' format + + May be repeated to provide multiple inputs. Only applicable together with --from-template. Required inputs that are + not provided (and have no default) are prompted for interactively. +``` + + ## `mw stack delete [STACK-ID]` Delete a container stack @@ -44,6 +114,11 @@ FLAG DESCRIPTIONS This flag controls if you want to see the process output or only a summary. When using mw non-interactively (e.g. in scripts), you can use this flag to easily get the IDs of created resources for further processing. + + -v, --with-volumes also include remove volumes in removal + + Only relevant for a project's default stack, which is emptied instead of removed; the volumes of any other stack are + removed together with the stack itself. ``` @@ -90,6 +165,8 @@ FLAG DESCRIPTIONS --from-template= deploy from a GitHub template (e.g., mittwald/n8n) + DEPRECATED: use "mw stack create --from-template" instead. This flag uses an older, GitHub-based template mechanism. + Fetch and deploy a stack from a GitHub template repository. Template names are automatically converted to repository names by prefixing "stack-template-" to the name part. @@ -248,6 +325,11 @@ FLAG DESCRIPTIONS This flag controls if you want to see the process output or only a summary. When using mw non-interactively (e.g. in scripts), you can use this flag to easily get the IDs of created resources for further processing. + + -v, --with-volumes also include remove volumes in removal + + Only relevant for a project's default stack, which is emptied instead of removed; the volumes of any other stack are + removed together with the stack itself. ``` ## `mw stack set-update-schedule STACK-ID SCHEDULE` @@ -281,6 +363,150 @@ FLAG DESCRIPTIONS ``` +## `mw stack template install TEMPLATE-ID` + +Install a template into an existing container stack + +``` +USAGE + $ mw stack template install TEMPLATE-ID [--token ] [-s ] [-q] [--input ...] + +ARGUMENTS + TEMPLATE-ID ID of the container template to install + +FLAGS + -q, --quiet suppress process output and only display a machine-readable summary + -s, --stack-id= ID of a stack; this flag is optional if a default stack is set in the context + --input=... user input for the template, in 'name=value' format + +AUTHENTICATION FLAGS + --token= API token to use for authentication (overrides environment and config file). NOTE: watch out that + tokens passed via this flag might be logged in your shell history. + +DESCRIPTION + Install a template into an existing container stack + + Adds the services and volumes of a container template to a stack that already exists, instead of creating a new stack + for it. + + This is intended for templates of type "component"; use "mw stack create --from-template" to create a new stack from a + standalone template. + + Template user inputs can be supplied non-interactively with one or more --input flags in 'name=value' format; any + required inputs that are neither provided nor have a default value are prompted for interactively. + +EXAMPLES + Install a template into the stack from the current context + + $ mw stack template install + + Install a template into a specific stack, with inputs + + $ mw stack template install --stack-id --input DB_NAME=mydb + +FLAG DESCRIPTIONS + -q, --quiet suppress process output and only display a machine-readable summary + + This flag controls if you want to see the process output or only a summary. When using mw non-interactively (e.g. in + scripts), you can use this flag to easily get the IDs of created resources for further processing. + + -s, --stack-id= ID of a stack; this flag is optional if a default stack is set in the context + + May contain a ID of a stack; you can also use the "mw context set --stack-id=" command to persistently set a + default stack for all commands that accept this flag. + + --input=... user input for the template, in 'name=value' format + + May be repeated to provide multiple inputs. Required inputs that are not provided (and have no default) are prompted + for interactively. +``` + + +## `mw stack template list` + +List container templates that stacks can be created from. + +``` +USAGE + $ mw stack template list -o txt|json|yaml|csv|tsv [--token ] [-x] [--no-header] [--no-truncate] + [--no-relative-dates] [--csv-separator ,|;] [--category ] [--type component|standalone] + +FLAGS + -o, --output=