-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathenvironment.go
More file actions
35 lines (31 loc) · 1.06 KB
/
environment.go
File metadata and controls
35 lines (31 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package environment
import (
"github.com/MakeNowJust/heredoc/v2"
cmdCreate "github.com/OctopusDeploy/cli/pkg/cmd/environment/create"
cmdDelete "github.com/OctopusDeploy/cli/pkg/cmd/environment/delete"
cmdList "github.com/OctopusDeploy/cli/pkg/cmd/environment/list"
cmdView "github.com/OctopusDeploy/cli/pkg/cmd/environment/view"
"github.com/OctopusDeploy/cli/pkg/constants"
"github.com/OctopusDeploy/cli/pkg/constants/annotations"
"github.com/OctopusDeploy/cli/pkg/factory"
"github.com/spf13/cobra"
)
func NewCmdEnvironment(f factory.Factory) *cobra.Command {
cmd := &cobra.Command{
Use: "environment <command>",
Short: "Manage environments",
Long: "Manage environments in Octopus Deploy",
Example: heredoc.Docf(`
$ %[1]s environment list
$ %[1]s environment ls
`, constants.ExecutableName),
Annotations: map[string]string{
annotations.IsInfrastructure: "true",
},
}
cmd.AddCommand(cmdList.NewCmdList(f))
cmd.AddCommand(cmdDelete.NewCmdDelete(f))
cmd.AddCommand(cmdCreate.NewCmdCreate(f))
cmd.AddCommand(cmdView.NewCmdView(f))
return cmd
}