command

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoHostsConfigured = errors.New("no hosts configured")
)
View Source
var (
	PluginFuncs = map[string]func(ExecPluginOptions, *plugin.Plugin) (any, error){
		"apply":       applyPlugin,
		"filter":      filterPlugin,
		"onPrClosed":  onPrClosedPlugin,
		"onPrCreated": onPrCreatedPlugin,
		"onPrMerged":  onPrMergedPlugin,
	}
)

Functions

func ExecPlugin added in v0.12.0

func ExecPlugin(funcName string, opts ExecPluginOptions) error

ExecPlugin executes the function of a plugin specified by `funcName`. It creates a temporary directory if `opts` doesn't specify one. It decodes the context content to send to the plugin from JSON.

Types

type CiRunner added in v0.14.0

type CiRunner struct {
	Opts options.Opts
}

func NewCiRunner added in v0.14.0

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

func NewCiRunnerFromConfig added in v0.14.0

func NewCiRunnerFromConfig(configFile string, skipPlugins bool) (*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 added in v0.14.0

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 ExecPluginOptions added in v0.12.0

type ExecPluginOptions struct {
	Addr      string
	Config    map[string]string
	Context   *protoV1.Context
	LogFormat string
	LogLevel  string
	Out       io.Writer
	Path      string
	WorkDir   string
}

ExecPluginOptions defines all options expected by function ExecPlugin.

type Run added in v0.9.0

type Run struct {
	DryRun           bool
	Hosts            []host.Host
	Processor        processor.RepositoryTaskProcessor
	PushGateway      *push.Pusher
	RepositoryLister host.RepositoryLister
	TaskRegistry     *task.Registry
}

func (*Run) Run added in v0.9.0

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) ([]RunResult, error)

type TryRunner

type TryRunner struct {
	ApplyActionsFunc func(actions []action.Action, ctx context.Context, dir string) error
	GitClient        git.GitClient
	Hosts            []host.Host
	Inputs           map[string]string
	Out              io.Writer
	Registry         *task.Registry
	RepositoryName   string
	TaskFile         string
	TaskName         string
}

func NewTryRunner

func NewTryRunner(opts options.Opts, dataDir string, repositoryName string, taskFile string, taskName string, inputs map[string]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