Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move stacks directly under cd category
Browse files Browse the repository at this point in the history
maciaszczykm committed Dec 10, 2024
1 parent bec7df4 commit 61c4f07
Showing 6 changed files with 44 additions and 13 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion cmd/command/auth/auth.go
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ func Command(clients client.Plural) cli.Command {
}
return cli.Command{
Name: "auth",
Usage: "Handles authentication to the plural api",
Usage: "handles authentication to the plural api",
Subcommands: p.authCommands(),
}
}
1 change: 0 additions & 1 deletion cmd/command/cd/cd.go
Original file line number Diff line number Diff line change
@@ -74,7 +74,6 @@ func Commands(clients client.Plural, helmConfiguration *action.Configuration) []
p.cdPipelines(),
p.cdNotifications(),
p.cdSettings(),
p.cdStacks(),
{
Name: "install",
Action: p.handleInstallDeploymentsOperator,
2 changes: 2 additions & 0 deletions cmd/command/plural/plural.go
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ import (
"github.com/pluralsh/plural-cli/cmd/command/mgmt"
"github.com/pluralsh/plural-cli/cmd/command/pr"
"github.com/pluralsh/plural-cli/cmd/command/profile"
"github.com/pluralsh/plural-cli/cmd/command/stacks"
"github.com/pluralsh/plural-cli/cmd/command/up"
"github.com/pluralsh/plural-cli/cmd/command/version"
"github.com/pluralsh/plural-cli/pkg/client"
@@ -109,6 +110,7 @@ func CreateNewApp(plural *Plural) *cli.App {
down.Command(),
mgmt.Command(plural.Plural),
profile.Command(),
stacks.Command(plural.Plural),
pr.Command(plural.Plural),
cmdinit.Command(plural.Plural),
up.Command(plural.Plural),
50 changes: 40 additions & 10 deletions cmd/command/cd/cd_stacks.go → cmd/command/stacks/stacks.go
Original file line number Diff line number Diff line change
@@ -1,28 +1,58 @@
package cd
package stacks

import (
"fmt"

"github.com/pluralsh/plural-cli/pkg/common"

"github.com/AlecAivazis/survey/v2"
"github.com/samber/lo"
"github.com/urfave/cli"

"github.com/pluralsh/plural-cli/pkg/client"
"github.com/pluralsh/plural-cli/pkg/common"
"github.com/pluralsh/plural-cli/pkg/config"
"github.com/pluralsh/plural-cli/pkg/stacks"
"github.com/pluralsh/plural-cli/pkg/utils/git"
"github.com/samber/lo"
"github.com/urfave/cli"
)

func (p *Plural) cdStacks() cli.Command {
func init() {
consoleToken = ""
consoleURL = ""
}

var consoleToken string
var consoleURL string

type Plural struct {
client.Plural
}

func Command(clients client.Plural) cli.Command {
p := Plural{
Plural: clients,
}
return cli.Command{
Name: "stacks",
Subcommands: p.cdStacksCommands(),
Usage: "manage CD stacks",
Aliases: []string{"s"},
Usage: "manage infrastructure stacks",
Subcommands: p.stacksCommands(),
Category: "CD",
Flags: []cli.Flag{
cli.StringFlag{
Name: "token",
Usage: "console token",
EnvVar: "PLURAL_CONSOLE_TOKEN",
Destination: &consoleToken,
},
cli.StringFlag{
Name: "url",
Usage: "console url address",
EnvVar: "PLURAL_CONSOLE_URL",
Destination: &consoleURL,
},
},
}
}

func (p *Plural) cdStacksCommands() []cli.Command {
func (p *Plural) stacksCommands() []cli.Command {
return []cli.Command{
{
Name: "gen-backend",
2 changes: 1 addition & 1 deletion cmd/command/version/version.go
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ func Command() cli.Command {
return cli.Command{
Name: "version",
Aliases: []string{"v", "vsn"},
Usage: "Gets cli version info",
Usage: "gets plural cli version info",
Action: common.VersionInfo,
}
}

0 comments on commit 61c4f07

Please sign in to comment.