Documentation ¶
Overview ¶
Package executor provides the ability for Vela to integrate with different supported operating systems.
Usage:
import "github.com/go-vela/worker/executor"
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Flags = []cli.Flag{ &cli.StringFlag{ EnvVars: []string{"EXECUTOR_LOG_LEVEL", "VELA_LOG_LEVEL", "LOG_LEVEL"}, Name: "executor.log.level", Usage: "sets the log level for the executor", Value: "info", }, &cli.StringFlag{ EnvVars: []string{"VELA_EXECUTOR_DRIVER", "EXECUTOR_DRIVER"}, Name: "executor.driver", Usage: "sets the driver to be used for the executor", Value: constants.DriverLinux, }, }
Flags represents all supported command line interface (CLI) flags for the executor.
Functions ¶
func WithContext ¶
WithContext inserts the executor Engine into the context.Context.
func WithGinContext ¶
WithGinContext inserts the executor Engine into the gin.Context.
Types ¶
type Engine ¶
type Engine interface { // GetBuild defines a function for the API // that gets the current build in execution. GetBuild() (*library.Build, error) // GetPipeline defines a function for the API // that gets the current pipeline in execution. GetPipeline() (*pipeline.Build, error) // GetRepo defines a function for the API // that gets the current repo in execution. GetRepo() (*library.Repo, error) // KillBuild defines a function for the API // that kills the current build in execution. KillBuild() (*library.Build, error) // CreateBuild defines a function that // configures the build for execution. CreateBuild(context.Context) error // PlanBuild defines a function that // prepares the build for execution. PlanBuild(context.Context) error // ExecBuild defines a function that // runs a pipeline for a build. ExecBuild(context.Context) error // DestroyBuild defines a function that // cleans up the build after execution. DestroyBuild(context.Context) error // PullSecret defines a function that pulls // the secrets for a given pipeline. PullSecret(context.Context) error // CreateService defines a function that // configures the service for execution. CreateService(context.Context, *pipeline.Container) error // PlanService defines a function that // prepares the service for execution. PlanService(context.Context, *pipeline.Container) error // ExecService defines a function that // runs a service. ExecService(context.Context, *pipeline.Container) error // StreamService defines a function that // tails the output for a service. StreamService(context.Context, *pipeline.Container) error // DestroyService defines a function that // cleans up the service after execution. DestroyService(context.Context, *pipeline.Container) error // CreateStage defines a function that // configures the stage for execution. CreateStage(context.Context, *pipeline.Stage) error // PlanStage defines a function that // prepares the stage for execution. PlanStage(context.Context, *pipeline.Stage, map[string]chan error) error // ExecStage defines a function that // runs a stage. ExecStage(context.Context, *pipeline.Stage, map[string]chan error) error // DestroyStage defines a function that // cleans up the stage after execution. DestroyStage(context.Context, *pipeline.Stage) error // CreateStep defines a function that // configures the step for execution. CreateStep(context.Context, *pipeline.Container) error // PlanStep defines a function that // prepares the step for execution. PlanStep(context.Context, *pipeline.Container) error // ExecStep defines a function that // runs a step. ExecStep(context.Context, *pipeline.Container) error // StreamStep defines a function that // tails the output for a step. StreamStep(context.Context, *pipeline.Container) error // DestroyStep defines a function that // cleans up the step after execution. DestroyStep(context.Context, *pipeline.Container) error }
Engine represents the interface for Vela integrating with the different supported operating systems.
func FromContext ¶
FromContext retrieves the executor Engine from the context.Context.
func FromGinContext ¶
FromGinContext retrieves the executor Engine from the gin.Context.
type Setup ¶
type Setup struct { // specifies the executor driver to use Driver string // specifies the executor hostname Hostname string // API client for sending requests to Vela Client *vela.Client // engine used for creating runtime resources Runtime runtime.Engine // resource for storing build information in Vela Build *library.Build // resource for storing pipeline information in Vela Pipeline *pipeline.Build // resource for storing repo information in Vela Repo *library.Repo // resource for storing user information in Vela User *library.User }
Setup represents the configuration necessary for creating a Vela engine capable of integrating with a configured executor.
func (*Setup) Darwin ¶
Darwin creates and returns a Vela engine capable of integrating with a Darwin executor.
func (*Setup) Linux ¶
Linux creates and returns a Vela engine capable of integrating with a Linux executor.