(f factory.Factory)
| 81 | } |
| 82 | |
| 83 | func 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 | |
| 106 | func createRun(opts *CreateOptions) error { |
| 107 |
nothing calls this directly
no test coverage detected