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

Function ProcessTasks

pkg/executor/executor.go:41–69  ·  view source on GitHub ↗

ProcessTasks iterates over the list of tasks and attempts to run them all. If everything goes well, a nil error will be returned. On the first failure, the error will be returned and the process will halt. TODO some kind of progress/results callback? A Goroutine with channels?

(octopus *client.Client, space *spaces.Space, tasks []*Task)

Source from the content-addressed store, hash-verified

39// On the first failure, the error will be returned and the process will halt.
40// TODO some kind of progress/results callback? A Goroutine with channels?
41func ProcessTasks(octopus *client.Client, space *spaces.Space, tasks []*Task) error {
42 for _, task := range tasks {
43 switch task.Type {
44 case TaskTypeCreateAccount:
45 if err := accountCreate(octopus, space, task.Options); err != nil {
46 return err
47 }
48 case TaskTypeCreateRelease:
49 if err := releaseCreate(octopus, space, task.Options); err != nil {
50 return err
51 }
52 case TaskTypeDeployRelease:
53 if err := releaseDeploy(octopus, space, task.Options); err != nil {
54 return err
55 }
56 case TaskTypeRunbookRun:
57 if err := runbookRun(octopus, space, task.Options); err != nil {
58 return err
59 }
60 case TaskTypeGitRunbookRun:
61 if err := gitRunbookRun(octopus, space, task.Options); err != nil {
62 return err
63 }
64 default:
65 return fmt.Errorf("unhandled task CommandType %s", task.Type)
66 }
67 }
68 return nil
69}

Callers 5

deployRunFunction · 0.92
createRunFunction · 0.92
runDbRunbookFunction · 0.92
runGitRunbookFunction · 0.92
processRunbookTasksFunction · 0.92

Calls 5

accountCreateFunction · 0.85
releaseCreateFunction · 0.85
releaseDeployFunction · 0.85
gitRunbookRunFunction · 0.85
runbookRunFunction · 0.70

Tested by

no test coverage detected