runner

package
v0.0.0-...-071fc36 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Debug bool
)

Functions

func MatchBranchPattern

func MatchBranchPattern(branch string, pattern string) bool

func ParseBranchPattern

func ParseBranchPattern(branches interface{}) ([]string, error)

func Run

func Run(ctx context.Context, params Params) error

Run starts an API server and a `buildkite-agent` process that is listening for jobs against that api.

An initial command is used to upload some pipeline yaml to the server, which is then broken up into steps and run through foreground processing and filtering based on the runner params.

Steps are then added as scheduled Jobs via the API server, where they are processed by the waiting agent process. The API server handles results and state change and finally updates the state of the job.

Types

type Agent

type Agent struct {
	Dir      string
	Env      []string
	Endpoint string

	sync.Mutex
	// contains filtered or unexported fields
}

func (*Agent) Run

func (a *Agent) Run(ctx context.Context) error

func (*Agent) Stop

func (a *Agent) Stop() error

type Artifact

type Artifact struct {
	ID                string `json:"-"`
	Path              string `json:"path"`
	AbsolutePath      string `json:"absolute_path"`
	GlobPath          string `json:"glob_path"`
	FileSize          int64  `json:"file_size"`
	Sha1Sum           string `json:"sha1sum"`
	URL               string `json:"url,omitempty"`
	UploadDestination string `json:"upload_destination,omitempty"`
	// contains filtered or unexported fields
}

type Build

type Build struct {
	ID     string
	Number int
	URL    string
}

type Job

type Job struct {
	ID               string
	Build            Build
	State            string
	ProjectSlug      string
	PipelineSlug     string
	OrganizationSlug string
	ArtifactPaths    []string
	CreatorName      string
	CreatorEmail     string
	Command          string
	Label            string
	Timeout          int
	Repository       string
	Commit           string
	Branch           string
	Tag              string
	Message          string
	RetryCount       int
	Plugins          []Plugin
	Env              []string
	Artifacts        []Artifact
}

type Params

type Params struct {
	Debug       bool
	DebugHTTP   bool
	Env         []string
	Metadata    map[string]string
	Dir         string
	Command     string
	Prompt      bool
	StepFilter  *regexp.Regexp
	DryRun      bool
	JobTemplate Job
	ListenPort  int
}

type Plugin

type Plugin struct {
	Name   string
	Params interface{}
}

func (Plugin) Repository

func (p Plugin) Repository() string

Jump to

Keyboard shortcuts

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