mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2024-11-26 14:53:52 +03:00
7486d2ab91
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
26 lines
512 B
Go
26 lines
512 B
Go
package runtime
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gitea.com/gitea/act_runner/client"
|
|
runnerv1 "gitea.com/gitea/proto-go/runner/v1"
|
|
|
|
log "github.com/sirupsen/logrus"
|
|
)
|
|
|
|
// Runner runs the pipeline.
|
|
type Runner struct {
|
|
Machine string
|
|
Environ map[string]string
|
|
Client client.Client
|
|
}
|
|
|
|
// Run runs the pipeline stage.
|
|
func (s *Runner) Run(ctx context.Context, task *runnerv1.Task) error {
|
|
l := log.
|
|
WithField("task.id", task.Id)
|
|
l.Info("start running pipeline")
|
|
|
|
return NewTask(task.Id, s.Client).Run(ctx, task)
|
|
}
|