Skip to content

Commit c12aaa4

Browse files
committed
cmd *: make tag comma separated options allowed
1 parent 7738c2b commit c12aaa4

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

cmd/deploy.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var (
2626
func init() {
2727
rootCmd.AddCommand(deployCmd)
2828
deployCmd.Flags().StringVar(&stacks, "stacks", "", "Filter stacks to deploy")
29-
deployCmd.Flags().StringVar(&tag, "tag", "", "Filter accounts and organization units to deploy")
29+
deployCmd.Flags().StringVar(&tag, "tag", "", "Filter accounts and organization units to deploy with a comma separated list")
3030
deployCmd.Flags().StringVar(&targets, "targets", "", "Filter resource types to deploy. Options: organization, scp, stacks")
3131
deployCmd.Flags().StringVar(&orgFile, "org", "organization.yml", "Path to the organization.yml file")
3232
deployCmd.Flags().BoolVar(&useTUI, "tui", false, "use the TUI for deploy")

cmd/diff.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
func init() {
1717
rootCmd.AddCommand(diffCmd)
1818
diffCmd.Flags().StringVar(&stacks, "stacks", "", "Filter stacks to deploy")
19-
diffCmd.Flags().StringVar(&tag, "tag", "", "Filter accounts and organization units to deploy.")
19+
diffCmd.Flags().StringVar(&tag, "tag", "", "Filter accounts and organization units to deploy with a comma separated list")
2020
diffCmd.Flags().StringVar(&targets, "targets", "", "Filter resource types to deploy. Options: organization, scp, stacks")
2121
diffCmd.Flags().StringVar(&orgFile, "org", "organization.yml", "Path to the organization.yml file")
2222
diffCmd.Flags().BoolVar(&useTUI, "tui", false, "use the TUI for diff")

cmd/root.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,13 @@ func ProcessOrgEndToEnd(consoleUI runner.ConsoleUI, cmd int, targets []string) e
104104
}
105105

106106
if len(targets) == 0 || deployStacks {
107+
totalTags := strings.Split(tag, ",")
107108
var accountsToApply []resource.Account
108109
for _, acct := range rootAWSOU.AllDescendentAccounts() {
109-
if contains(tag, acct.AllTags()) || tag == "" {
110-
accountsToApply = append(accountsToApply, *acct)
110+
for _, tag := range totalTags {
111+
if contains(tag, acct.AllTags()) || tag == "" {
112+
accountsToApply = append(accountsToApply, *acct)
113+
}
111114
}
112115
}
113116

mintlifydocs/commands/deploy.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Flags:
1010
-h, --help help for deploy
1111
--org string Path to the organization.yml file (default "organization.yml")
1212
--stacks string Filter stacks to deploy
13-
--tag string Filter accounts and account groups to deploy
13+
--tag string Filter accounts and account groups to deploy via a comma separated list
1414
--tui use the TUI for deploy
1515
```
1616

mintlifydocs/commands/diff.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Flags:
1010
-h, --help help for diff
1111
--org string Path to the organization.yml file (default "organization.yml")
1212
--stacks string Filter stacks to diff
13-
--tag string Filter accounts and account groups to diff.
13+
--tag string Filter accounts and account groups to diff via a comma separated list.
1414
--tui use the TUI for diff
1515
```
1616

0 commit comments

Comments
 (0)