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

Function PrintAdvancedSummary

pkg/cmd/runbook/run/run.go:1236–1286  ·  view source on GitHub ↗
(stdout io.Writer, options *executor.TaskOptionsRunbookRunBase)

Source from the content-addressed store, hash-verified

1234}
1235
1236func PrintAdvancedSummary(stdout io.Writer, options *executor.TaskOptionsRunbookRunBase) {
1237 runAtStr := "Now"
1238 if options.ScheduledStartTime != "" {
1239 runAtStr = options.ScheduledStartTime // we assume the server is going to understand this
1240 }
1241 skipStepsStr := "None"
1242 if len(options.ExcludedSteps) > 0 {
1243 skipStepsStr = strings.Join(options.ExcludedSteps, ",")
1244 }
1245
1246 gfmStr := executionscommon.LookupGuidedFailureModeString(options.GuidedFailureMode)
1247
1248 pkgDownloadStr := executionscommon.LookupPackageDownloadString(!options.ForcePackageDownload)
1249
1250 runTargetsStr := "All included"
1251 if len(options.RunTargets) != 0 || len(options.ExcludeTargets) != 0 {
1252 sb := strings.Builder{}
1253 if len(options.RunTargets) > 0 {
1254 sb.WriteString("Include ")
1255 for idx, name := range options.RunTargets {
1256 if idx > 0 {
1257 sb.WriteString(",")
1258 }
1259 sb.WriteString(name)
1260 }
1261 }
1262 if len(options.ExcludeTargets) > 0 {
1263 if sb.Len() > 0 {
1264 sb.WriteString("; ")
1265 }
1266
1267 sb.WriteString("Exclude ")
1268 for idx, name := range options.ExcludeTargets {
1269 if idx > 0 {
1270 sb.WriteString(",")
1271 }
1272 sb.WriteString(name)
1273 }
1274 }
1275 runTargetsStr = sb.String()
1276 }
1277
1278 _, _ = fmt.Fprintf(stdout, output.FormatDoc(heredoc.Doc(`
1279 bold(Additional Options):
1280 Run At: cyan(%s)
1281 Skipped Steps: cyan(%s)
1282 Guided Failure Mode: cyan(%s)
1283 Package Download: cyan(%s)
1284 Run Targets: cyan(%s)
1285 `)), runAtStr, skipStepsStr, gfmStr, pkgDownloadStr, runTargetsStr)
1286}
1287
1288func selectRunbook(octopus *octopusApiClient.Client, ask question.Asker, questionText string, space *spaces.Space, project *projects.Project) (*runbooks.Runbook, error) {
1289 foundRunbooks, err := runbooks.List(octopus, space.ID, project.ID, "", math.MaxInt32)

Callers 3

AskDbRunbookRunQuestionsFunction · 0.70

Calls 4

FormatDocFunction · 0.92
LenMethod · 0.80

Tested by 1