Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoHostsConfigured = errors.New("no hosts configured")
)
View Source
var ( // ErrRunFailed indicates that a run failed with an error ErrRunFailed = errors.New("run failed") )
Functions ¶
This section is empty.
Types ¶
type CiRunner ¶
func NewCiRunnerFromConfig ¶
NewCiRunnerFromConfig creates a new CiRunner by reading from configFile. It ignores some errors that are not relevant in a CI run.
type NewScheduleRunnerOptions ¶
type NewScheduleRunnerOptions struct {
HttpClient *http.Client
ServerApiKey string
ServerUrl string
}
NewScheduleRunnerOptions defines all options expected by NewScheduleRunner.
type Run ¶
type Run struct {
Clock clock.Clock
DryRun bool
Hosts []host.Host
Processor processor.RepositoryTaskProcessor
PullRequestCache host.PullRequestCache
PushGateway *push.Pusher
RepositoryLister host.RepositoryLister
TaskRegistry *task.Registry
}
type RunResult ¶
type ScheduleRunner ¶
type ScheduleRunner struct {
// contains filtered or unexported fields
}
ScheduleRunner wraps the logic to schedule a new run.
func NewScheduleRunner ¶
func NewScheduleRunner(opts NewScheduleRunnerOptions) (*ScheduleRunner, error)
NewScheduleRunner initializes a new ScheduleRunner from NewScheduleRunnerOptions.
func (*ScheduleRunner) Run ¶
func (s *ScheduleRunner) Run(opts ScheduleRunnerRunOptions) error
Run schedules a new run from payload via the API of Saturn server.
type ScheduleRunnerRunOptions ¶
type ScheduleRunnerRunOptions struct {
// OutLog is the writer that [ScheduleRunner]
// writes human-readable log messages to.
OutLog io.Writer
// OutReport is the writer that [ScheduleRunner]
// writes task results to, if the user requests it.
OutReport io.Writer
// OutputFormat defines the output format to use.
OutputFormat string
// ScheduleRequest is the data to send to Saturn server.
ScheduleRequest client.ScheduleRunV1Request
// WaitFor is the total amount of time to wait for the run to complete.
WaitFor time.Duration
// WaitInterval is the time between requests sent to Saturn server
// to check if the run has finished.
WaitInterval time.Duration
}
ScheduleRunnerRunOptions are all options expected by ScheduleRunnerRunOptions.
Click to show internal directories.
Click to hide internal directories.