Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terramate: updates from 0.4.6 #2277

Merged
merged 6 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions completers/terramate_completer/cmd/cloud.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var cloudCmd = &cobra.Command{
Use: "cloud",
Short: "Terramate Cloud commands",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(cloudCmd).Standalone()

rootCmd.AddCommand(cloudCmd)
}
18 changes: 18 additions & 0 deletions completers/terramate_completer/cmd/cloud_drift.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var cloud_driftCmd = &cobra.Command{
Use: "drift",
Short: "manage cloud drifts",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(cloud_driftCmd).Standalone()

cloudCmd.AddCommand(cloud_driftCmd)
}
18 changes: 18 additions & 0 deletions completers/terramate_completer/cmd/cloud_drift_show.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var cloud_drift_showCmd = &cobra.Command{
Use: "show",
Short: "show drifts",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(cloud_drift_showCmd).Standalone()

cloud_driftCmd.AddCommand(cloud_drift_showCmd)
}
18 changes: 18 additions & 0 deletions completers/terramate_completer/cmd/cloud_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var cloud_infoCmd = &cobra.Command{
Use: "info",
Short: "cloud information status",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(cloud_infoCmd).Standalone()

cloudCmd.AddCommand(cloud_infoCmd)
}
18 changes: 18 additions & 0 deletions completers/terramate_completer/cmd/cloud_login.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var cloud_loginCmd = &cobra.Command{
Use: "login",
Short: "login for cloud.terramate.io",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(cloud_loginCmd).Standalone()

cloudCmd.AddCommand(cloud_loginCmd)
}
4 changes: 3 additions & 1 deletion completers/terramate_completer/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ func init() {
carapace.Gen(createCmd).Standalone()

createCmd.Flags().StringSlice("after", []string{}, "Add a stack as after")
createCmd.Flags().Bool("all-terraform", false, "initialize all Terraform directories containing terraform.backend blocks defined")
createCmd.Flags().StringSlice("before", []string{}, "Add a stack as before")
createCmd.Flags().String("description", "", "Description of the stack, defaults to the stack name")
createCmd.Flags().Bool("ensure-stack-ids", false, "generate an UUID for the stack.id of all stacks which does not define it")
createCmd.Flags().String("id", "", "ID of the stack, defaults to UUID")
createCmd.Flags().Bool("ignore-existing", false, "If the stack already exists do nothing and don't fail")
createCmd.Flags().StringSlice("import", []string{}, "Add import block for the given path on the stack")
createCmd.Flags().String("name", "", "Name of the stack, defaults to stack dir base name")
createCmd.Flags().Bool("no-generate", false, "Disable code generation for the newly created stack")
createCmd.Flags().Bool("no-generate", false, "Disable code generation for the newly created stacks")
rootCmd.AddCommand(createCmd)

carapace.Gen(createCmd).FlagCompletion(carapace.ActionMap{
Expand Down
18 changes: 18 additions & 0 deletions completers/terramate_completer/cmd/debug.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var debugCmd = &cobra.Command{
Use: "debug",
Short: "Terramate debugging commands",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(debugCmd).Standalone()

rootCmd.AddCommand(debugCmd)
}
18 changes: 18 additions & 0 deletions completers/terramate_completer/cmd/debug_show.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var debug_showCmd = &cobra.Command{
Use: "show",
Short: "Show information available in the project",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(debug_showCmd).Standalone()

debugCmd.AddCommand(debug_showCmd)
}
18 changes: 18 additions & 0 deletions completers/terramate_completer/cmd/debug_show_generateOrigins.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var debug_show_generateOriginsCmd = &cobra.Command{
Use: "generate-origins",
Short: "Show generate debug information",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(debug_show_generateOriginsCmd).Standalone()

debug_showCmd.AddCommand(debug_show_generateOriginsCmd)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import (
"github.com/spf13/cobra"
)

var experimental_globalsCmd = &cobra.Command{
var debug_show_globalsCmd = &cobra.Command{
Use: "globals",
Short: "List globals for all stacks",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(experimental_globalsCmd).Standalone()
carapace.Gen(debug_show_globalsCmd).Standalone()

experimentalCmd.AddCommand(experimental_globalsCmd)
debug_showCmd.AddCommand(debug_show_globalsCmd)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import (
"github.com/spf13/cobra"
)

var experimental_metadataCmd = &cobra.Command{
var debug_show_metadataCmd = &cobra.Command{
Use: "metadata",
Short: "Shows metadata available on the project",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(experimental_metadataCmd).Standalone()
carapace.Gen(debug_show_metadataCmd).Standalone()

experimentalCmd.AddCommand(experimental_metadataCmd)
debug_showCmd.AddCommand(debug_show_metadataCmd)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import (
"github.com/spf13/cobra"
)

var experimental_runEnvCmd = &cobra.Command{
Use: "run-env",
var debug_show_runtimeEnvCmd = &cobra.Command{
Use: "runtime-env",
Short: "List run environment variables for all stacks",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(experimental_runEnvCmd).Standalone()
carapace.Gen(debug_show_runtimeEnvCmd).Standalone()

experimentalCmd.AddCommand(experimental_runEnvCmd)
debug_showCmd.AddCommand(debug_show_runtimeEnvCmd)
}
1 change: 1 addition & 0 deletions completers/terramate_completer/cmd/experimental_clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var experimental_cloneCmd = &cobra.Command{
func init() {
carapace.Gen(experimental_cloneCmd).Standalone()

experimental_cloneCmd.Flags().Bool("skip-child-stacks", false, "Clone ignores child stacks")
experimentalCmd.AddCommand(experimental_cloneCmd)

carapace.Gen(experimental_cloneCmd).PositionalCompletion(
Expand Down
18 changes: 0 additions & 18 deletions completers/terramate_completer/cmd/experimental_generate.go

This file was deleted.

18 changes: 0 additions & 18 deletions completers/terramate_completer/cmd/experimental_generate_debug.go

This file was deleted.

22 changes: 0 additions & 22 deletions completers/terramate_completer/cmd/experimental_runOrder.go

This file was deleted.

6 changes: 6 additions & 0 deletions completers/terramate_completer/cmd/experimental_trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@ var experimental_triggerCmd = &cobra.Command{
func init() {
carapace.Gen(experimental_triggerCmd).Standalone()

experimental_triggerCmd.Flags().String("cloud-status", "", "Filter by status")
experimental_triggerCmd.Flags().String("experimental-status", "", "Filter by status (Deprecated)")
experimental_triggerCmd.Flags().String("reason", "", "Reason for the stack being triggered")
experimentalCmd.AddCommand(experimental_triggerCmd)

carapace.Gen(experimental_triggerCmd).FlagCompletion(carapace.ActionMap{
"cloud-status": terramate.ActionCloudStatus(),
})

carapace.Gen(experimental_triggerCmd).PositionalCompletion(
terramate.ActionStacks(),
)
Expand Down
1 change: 1 addition & 0 deletions completers/terramate_completer/cmd/fmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ func init() {
carapace.Gen(fmtCmd).Standalone()

fmtCmd.Flags().Bool("check", false, "Lists unformatted files, exit with 0 if all is formatted, 1 otherwise")
fmtCmd.Flags().Bool("detailed-exit-code", false, "Return an appropriate exit code (0 = ok, 1 = error, 2 = no error but changes were made)")
rootCmd.AddCommand(fmtCmd)
}
1 change: 1 addition & 0 deletions completers/terramate_completer/cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ var generateCmd = &cobra.Command{
func init() {
carapace.Gen(generateCmd).Standalone()

generateCmd.Flags().Bool("detailed-exit-code", false, "Return detailed exit code (0 = ok, 1 = errors, 2 = no errors but changes were made")
rootCmd.AddCommand(generateCmd)
}
8 changes: 8 additions & 0 deletions completers/terramate_completer/cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/pkg/actions/tools/terramate"
"github.com/spf13/cobra"
)

Expand All @@ -14,6 +15,13 @@ var listCmd = &cobra.Command{
func init() {
carapace.Gen(listCmd).Standalone()

listCmd.Flags().String("cloud-status", "", "Filter by status")
listCmd.Flags().String("experimental-status", "", "Filter by status (Deprecated)")
listCmd.Flags().Bool("run-order", false, "Sort stacks by order of execution")
listCmd.Flags().Bool("why", false, "Shows the reason why the stack has changed")
rootCmd.AddCommand(listCmd)

carapace.Gen(listCmd).FlagCompletion(carapace.ActionMap{
"cloud-status": terramate.ActionCloudStatus(),
})
}
4 changes: 3 additions & 1 deletion completers/terramate_completer/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ func init() {
rootCmd.Flags().StringP("chdir", "C", "", "Sets working directory")
rootCmd.Flags().Bool("disable-check-git-uncommitted", false, "Disable git check for uncommitted files")
rootCmd.Flags().Bool("disable-check-git-untracked", false, "Disable git check for untracked files")
rootCmd.Flags().Bool("disable-checkpoint", false, "Disable checkpoint checks for updates")
rootCmd.Flags().Bool("disable-checkpoint-signature", false, "Disable checkpoint signature")
rootCmd.Flags().StringP("git-change-base", "B", "", "Git base ref for computing changes")
rootCmd.Flags().BoolP("help", "h", false, "Show context-sensitive help.")
rootCmd.Flags().String("log-destination", "", "Destination of log messages")
rootCmd.Flags().String("log-fmt", "", "Log format to use: 'console', 'text', or 'json'")
rootCmd.Flags().String("log-level", "", "Log level to use: 'disabled', 'trace', 'debug', 'info', 'warn', 'error', or 'fatal'")
rootCmd.Flags().StringSlice("no-tags", []string{}, "Filter stacks that do not have the given tags")
rootCmd.Flags().Bool("quiet", false, "Disable output")
rootCmd.Flags().StringSlice("tags", []string{}, "Filter stacks by tags. Use \":\" for logical AND and \",\" for logical OR. Example: --tags app:prod filters stacks containing tag \"app\" AND \"prod\". If multiple --tags are provided, an OR expression is created. Example: \"--tags A --tags B\" is the same as \"--tags A,B\"")
rootCmd.Flags().StringSlice("tags", []string{}, "Filter stacks by tags. Use \":\" for logical AND and \",\" for logical OR. Example: --tags app:prod filters stacks containing tag \"app\" AND \"prod\". If multiple --tags are provided, an OR expression is created. Example: \"--tags a --tags b\" is the same as \"--tags a,b\"")
rootCmd.Flags().StringSliceP("verbose", "v", []string{}, "Increase verboseness of output")
rootCmd.Flags().Bool("version", false, "Terramate version")

Expand Down
Loading
Loading