runner

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2020 License: MIT Imports: 21 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithJobLogger

func WithJobLogger(ctx context.Context, jobName string) context.Context

WithJobLogger attaches a new logger to context that is aware of steps

Types

type Config

type Config struct {
	Workdir         string            // path to working directory
	BindWorkdir     bool              // bind the workdir to the job container
	EventName       string            // name of event to run
	EventPath       string            // path to JSON file to use for event.json in containers
	ReuseContainers bool              // reuse containers to maintain state
	ForcePull       bool              // force pulling of the image, if already present
	LogOutput       bool              // log the output from docker run
	Secrets         map[string]string // list of secrets
	Platforms       map[string]string // list of platforms
}

Config contains the config for a new runner

type ExpressionEvaluator

type ExpressionEvaluator interface {
	Evaluate(string) (string, error)
	Interpolate(string) string
}

ExpressionEvaluator is the interface for evaluating expressions

type RunContext

type RunContext struct {
	Config       *Config
	Matrix       map[string]interface{}
	Run          *model.Run
	EventJSON    string
	Env          map[string]string
	ExtraPath    []string
	CurrentStep  string
	StepResults  map[string]*stepResult
	ExprEval     ExpressionEvaluator
	JobContainer container.Container
}

RunContext contains info about current job

func (*RunContext) ActionCacheDir added in v0.2.2

func (rc *RunContext) ActionCacheDir() string

ActionCacheDir is for rc

func (*RunContext) EvalBool

func (rc *RunContext) EvalBool(expr string) bool

EvalBool evaluates an expression against current run context

func (*RunContext) Executor

func (rc *RunContext) Executor() common.Executor

Executor returns a pipeline executor for all the steps in the job

func (*RunContext) GetEnv

func (rc *RunContext) GetEnv() map[string]string

GetEnv returns the env for the context

func (*RunContext) NewExpressionEvaluator

func (rc *RunContext) NewExpressionEvaluator() ExpressionEvaluator

NewExpressionEvaluator creates a new evaluator

type Runner

type Runner interface {
	NewPlanExecutor(plan *model.Plan) common.Executor
}

Runner provides capabilities to run GitHub actions

func New

func New(runnerConfig *Config) (Runner, error)

New Creates a new Runner

type StepContext added in v0.2.2

type StepContext struct {
	RunContext *RunContext
	Step       *model.Step
	Env        map[string]string
	Cmd        []string
	Action     *model.Action
}

StepContext contains info about current job

func (*StepContext) Executor added in v0.2.2

func (sc *StepContext) Executor() common.Executor

Executor for a step context

func (*StepContext) NewExpressionEvaluator added in v0.2.2

func (sc *StepContext) NewExpressionEvaluator() ExpressionEvaluator

NewExpressionEvaluator creates a new evaluator

Jump to

Keyboard shortcuts

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