-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
Users seem to expect [STACK_NAME..] arguments to commands as the way you limit processing to those stacks.
This is reasonable, but we don't do it that way for a few of reasons:
- Arguments at the end of sub-commands need to be implemented individually for those sub-commands; since filtering applies to everything, we chose to implement a global option instead. I'll admit, I do not know how global arguments work.
- The most common use-case for this filtering is on CI, filtering to changed stacks. In that context, producing a comma-separated list (
--filter=a,b,cis easier than multiple positional options (--filter a --filter b --filter c). I also find it makes the OR nature more apparent. - Wanting to deploy things in a group ("all prod stacks", "all memcached stacks", etc) is common too, so we support globs
All of this together has resulted in the current option:
stackctl --filter 'prod/*' deploystackctl --filter 'iam.yaml,apps/*/iam.yaml' catWe should do two things to clarify this:
1- Add EXAMPLES to (at least) stackctl.1 that show how to use --filter
This may be happening in #104, so we should include this there.
2- Ensure that global options appear in sub-command --help output.
Today,
% stackctl deploy --help
Usage: stackctl deploy [-p|--parameter KEY=[VALUE]] [-t|--tag KEY=[VALUE]]
[--save-change-sets DIRECTORY] [--no-confirm]
[--no-remove] [--clean]
Deploy specifications
Available options:
-p,--parameter KEY=[VALUE]
Override the given Parameter for this operation
-t,--tag KEY=[VALUE] Override the given Tag for this operation
--save-change-sets DIRECTORY
Save executed changesets to DIRECTORY
--no-confirm Don't confirm changes before executing
--no-remove Don't delete removed Stacks
--clean Remove all changesets from Stack after deploy
-h,--help Show this help textHow it should look,
% stackctl deploy --help
Usage: stackctl deploy [-p|--parameter KEY=[VALUE]] [-t|--tag KEY=[VALUE]]
[--save-change-sets DIRECTORY] [--no-confirm]
[--no-remove] [--clean]
Deploy specifications
Available options:
-p,--parameter KEY=[VALUE]
Override the given Parameter for this operation
-t,--tag KEY=[VALUE] Override the given Tag for this operation
--save-change-sets DIRECTORY
Save executed changesets to DIRECTORY
--no-confirm Don't confirm changes before executing
--no-remove Don't delete removed Stacks
--clean Remove all changesets from Stack after deploy
-h,--help Show this help text
Global options:
-d,--directory PATH Operate on specifications in PATH
--filter PATTERN[,PATTERN]
Filter specifications to match PATTERN(s)
--color auto|always|never
When to colorize output
-v,--verbose Increase verbosity (can be passed multiple times)
--auto-sso WHEN Automatically run aws-sso-login if necessary?I think we simply need to use the helpShowGlobals modifier, as per docs:
Global options are off by default, to enable them, use
thehelpShowGlobalsmodifier.
Metadata
Metadata
Assignees
Labels
No labels