MCPcopy Index your code
hub / github.com/devspace-sh/devspace / Run

Method Run

pkg/devspace/pipeline/job.go:62–94  ·  view source on GitHub ↗
(ctx devspacecontext.Context, args []string, environ expand.Environ)

Source from the content-addressed store, hash-verified

60}
61
62func (j *Job) Run(ctx devspacecontext.Context, args []string, environ expand.Environ) error {
63 if ctx.IsDone() {
64 return ctx.Context().Err()
65 }
66
67 j.m.Lock()
68 ctx = ctx.WithContext(j.t.Context(ctx.Context()))
69 t := j.t
70 j.m.Unlock()
71
72 t.Go(func() error {
73 // start the actual job
74 done := t.NotifyGo(func() error {
75 return j.execute(ctx, args, t, environ)
76 })
77
78 // wait until job is dying
79 select {
80 case <-ctx.Context().Done():
81 return nil
82 case <-done:
83 }
84
85 // check if errored
86 if !t.Alive() {
87 return t.Err()
88 }
89
90 return nil
91 })
92
93 return t.Wait()
94}
95
96func (j *Job) execute(ctx devspacecontext.Context, args []string, parent *tomb.Tomb, environ expand.Environ) error {
97 ctx = ctx.WithLogger(ctx.Log())

Callers

nothing calls this directly

Calls 12

executeMethod · 0.95
LockMethod · 0.80
UnlockMethod · 0.80
GoMethod · 0.80
NotifyGoMethod · 0.80
AliveMethod · 0.80
IsDoneMethod · 0.65
ContextMethod · 0.65
WithContextMethod · 0.65
DoneMethod · 0.65
WaitMethod · 0.65
ErrMethod · 0.45

Tested by

no test coverage detected