command

package
v0.50.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2026 License: AGPL-3.0 Imports: 28 Imported by: 0

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

type CiRunner struct {
	Opts options.Opts
}

func NewCiRunner

func NewCiRunner(opts options.Opts) (*CiRunner, error)

func NewCiRunnerFromConfig

func NewCiRunnerFromConfig(configFile string) (*CiRunner, error)

NewCiRunnerFromConfig creates a new CiRunner by reading from configFile. It ignores some errors that are not relevant in a CI run.

func (*CiRunner) Run

func (ci *CiRunner) Run(out io.Writer, taskFiles ...string) error

Run reads and validates taskFiles and writes a message to out for each file.

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
}

func (*Run) Run

func (r *Run) Run(repositoryNames, taskFiles []string, inputs map[string]string) ([]RunResult, error)

type RunResult

type RunResult struct {
	Error          error
	PullRequest    *host.PullRequest
	RepositoryName string
	Result         processor.Result
	TaskName       string
}

func ExecuteRun

func ExecuteRun(
	opts options.Opts,
	repositoryNames,
	taskFiles []string,
	inputs map[string]string,
	dataCache *cache.Cache,
) ([]RunResult, error)

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

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.

type TryRunner

type TryRunner struct {
	CommandExec    exec.Exec
	GitClient      git.GitClient
	Hosts          []host.Host
	Inputs         map[string]string
	Out            io.Writer
	Registry       *task.Registry
	RepositoryName string
	RunResult      processor.Result
	TaskFile       string
	TaskName       string
}

func NewTryRunner

func NewTryRunner(
	opts options.Opts,
	dataDir string,
	repositoryName string,
	taskFile string,
	taskName string,
	inputs map[string]string,
	action string,
) (*TryRunner, error)

func (*TryRunner) Run

func (r *TryRunner) Run() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL