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

Function NewCmdAllow

pkg/cmd/release/progression/allow/allow.go:52–86  ·  view source on GitHub ↗
(f factory.Factory)

Source from the content-addressed store, hash-verified

50}
51
52func NewCmdAllow(f factory.Factory) *cobra.Command {
53 allowFlags := NewAllowFlags()
54
55 cmd := &cobra.Command{
56 Use: "allow",
57 Short: "Allows a release to progress to the next phase.",
58 Long: "Allows a release to progress to the next phase in Octopus Deploy.",
59 Example: heredoc.Docf(`
60 %[1]s release progression allow --project MyProject --version 1.2.3
61 %[1]s release progression allow -p MyProject -v 1.2.3
62 %[1]s release progression allow -p MyProject -v 1.2.3 --no-prompt
63 `, constants.ExecutableName),
64 Aliases: []string{"allow-releaseprogression"},
65 RunE: func(c *cobra.Command, _ []string) error {
66 opts := NewAllowOptions(allowFlags, cmd.NewDependencies(f, c))
67 return resolveReleaseDefectRun(opts)
68 },
69 }
70
71 flags := cmd.Flags()
72 flags.StringVarP(&allowFlags.Project.Value, allowFlags.Project.Name, "p", "", "Name or ID of the project.")
73 flags.StringVarP(&allowFlags.Version.Value, allowFlags.Version.Name, "v", "", "Release version/number.")
74
75 flags.SortFlags = false
76
77 flagAliases := make(map[string][]string, 1)
78 util.AddFlagAliasesString(flags, FlagVersion, flagAliases, FlagAliasReleaseNumberLegacy)
79
80 cmd.PreRunE = func(cmd *cobra.Command, args []string) error {
81 util.ApplyFlagAliases(cmd.Flags(), flagAliases)
82 return nil
83 }
84
85 return cmd
86}
87
88func resolveReleaseDefectRun(opts *AllowOptions) error {
89 if !opts.NoPrompt {

Callers

nothing calls this directly

Calls 5

AddFlagAliasesStringFunction · 0.92
ApplyFlagAliasesFunction · 0.92
NewAllowFlagsFunction · 0.85
NewAllowOptionsFunction · 0.85
resolveReleaseDefectRunFunction · 0.85

Tested by

no test coverage detected