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

Function PromptMissing

pkg/cmd/environment/create/create.go:135–161  ·  view source on GitHub ↗
(opts *CreateOptions)

Source from the content-addressed store, hash-verified

133}
134
135func PromptMissing(opts *CreateOptions) error {
136 err := question.AskName(opts.Ask, "", "environment", &opts.Name.Value)
137 if err != nil {
138 return err
139 }
140
141 err = question.AskDescription(opts.Ask, "", "environment", &opts.Description.Value)
142 if err != nil {
143 return err
144 }
145
146 _, err = promptBool(opts, &opts.GuidedFailureMode.Value, false, "Use guided failure", "If guided failure is enabled for an environment, Octopus Deploy will prompt for user intervention if a deployment fails in the environment.")
147 _, err = promptBool(opts, &opts.DynamicInfrastructure.Value, false, "Allow dynamic infrastructure", "If dynamic infrastructure is enabled for an environment, deployments to this environment are allowed to create infrastructure, such as targets and accounts.")
148
149 tagSets, err := opts.GetAllTagsCallback()
150 if err != nil {
151 return err
152 }
153
154 tags, err := selectors.Tags(opts.Ask, []string{}, opts.Tag.Value, tagSets)
155 if err != nil {
156 return err
157 }
158 opts.Tag.Value = tags
159
160 return nil
161}
162
163func promptBool(opts *CreateOptions, value *bool, defaultValue bool, message string, help string) (bool, error) {
164 if *value != defaultValue {

Callers 1

createRunFunction · 0.70

Calls 4

AskNameFunction · 0.92
AskDescriptionFunction · 0.92
TagsFunction · 0.92
promptBoolFunction · 0.70

Tested by

no test coverage detected