MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / NewCmdCreate

Function NewCmdCreate

pkg/cmd/ephemeralenvironment/create/create.go:83–104  ·  view source on GitHub ↗
(f factory.Factory)

Source from the content-addressed store, hash-verified

81}
82
83func NewCmdCreate(f factory.Factory) *cobra.Command {
84 createFlags := NewCreateFlags()
85
86 cmd := &cobra.Command{
87 Use: "create",
88 Short: "Create an ephemeral environment",
89 Long: "Create an ephemeral environment in Octopus Deploy",
90 Example: heredoc.Docf("%s ephemeral-environment create", constants.ExecutableName),
91 Aliases: []string{"new"},
92 RunE: func(c *cobra.Command, _ []string) error {
93 opts := NewCreateOptions(createFlags, cmd.NewDependencies(f, c))
94
95 return createRun(opts)
96 },
97 }
98
99 flags := cmd.Flags()
100 flags.StringVarP(&createFlags.Name.Value, createFlags.Name.Name, "n", "", "Name of the environment")
101 flags.StringVarP(&createFlags.Project.Value, createFlags.Project.Name, "p", "", "Name of the project")
102
103 return cmd
104}
105
106func createRun(opts *CreateOptions) error {
107

Callers

nothing calls this directly

Calls 3

NewCreateFlagsFunction · 0.70
NewCreateOptionsFunction · 0.70
createRunFunction · 0.70

Tested by

no test coverage detected