-
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEV-2465: add atmos pro stack locking (#678)
- Loading branch information
Showing
19 changed files
with
1,347 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// proCmd executes 'atmos pro' CLI commands | ||
var proCmd = &cobra.Command{ | ||
Use: "pro", | ||
Short: "Execute 'pro' commands", | ||
Long: `This command executes 'atmos pro' CLI commands`, | ||
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: false}, | ||
} | ||
|
||
func init() { | ||
RootCmd.AddCommand(proCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package cmd | ||
|
||
import ( | ||
e "github.com/cloudposse/atmos/internal/exec" | ||
u "github.com/cloudposse/atmos/pkg/utils" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// proLockCmd executes 'pro lock' CLI command | ||
var proLockCmd = &cobra.Command{ | ||
Use: "lock", | ||
Short: "Lock a stack", | ||
Long: `This command calls the atmos pro API and locks a stack`, | ||
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: false}, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
// Check Atmos configuration | ||
checkAtmosConfig() | ||
|
||
err := e.ExecuteProLockCommand(cmd, args) | ||
if err != nil { | ||
u.LogErrorAndExit(err) | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
proLockCmd.PersistentFlags().StringP("component", "c", "", "Specify the Atmos component to lock") | ||
proLockCmd.PersistentFlags().StringP("stack", "s", "", "Specify the Atmos stack to lock") | ||
proLockCmd.PersistentFlags().StringP("message", "m", "", "The lock message to display if someone else tries to lock the stack. Defaults to 'Locked by Atmos'") | ||
proLockCmd.PersistentFlags().Int32P("ttl", "t", 0, "The amount of time in seconds to lock the stack for. Defaults to 30") | ||
|
||
proCmd.AddCommand(proLockCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package cmd | ||
|
||
import ( | ||
e "github.com/cloudposse/atmos/internal/exec" | ||
u "github.com/cloudposse/atmos/pkg/utils" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// proUnlockCmd executes 'pro unlock' CLI command | ||
var proUnlockCmd = &cobra.Command{ | ||
Use: "unlock", | ||
Short: "Unlock a stack", | ||
Long: `This command calls the atmos pro API and unlocks a stack`, | ||
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: false}, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
// Check Atmos configuration | ||
checkAtmosConfig() | ||
|
||
err := e.ExecuteProUnlockCommand(cmd, args) | ||
if err != nil { | ||
u.LogErrorAndExit(err) | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
proUnlockCmd.PersistentFlags().StringP("component", "c", "", "Specify the Atmos component to lock") | ||
proUnlockCmd.PersistentFlags().StringP("stack", "s", "", "Specify the Atmos stack to lock") | ||
|
||
proCmd.AddCommand(proUnlockCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.