spec

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(pd *PipelineDefinition, hook scm.Webhook, generateName string) (*pipelinev1.PipelineRun, error)

Execute takes a PipelineDefinition and a hook, and returns a PipelineRun and possibly an error.

The Filter on the definition is evaluated, and if it returns true, then the ParamBindings are evaluated and appended to the PipelineRunSpec's Params.

Finally a PipelineRun is returned, populated with the spec from the definition.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler implements the http.Handler interface, it grabs pipeline configurations from the incoming Hook's repository and attempts to generate a PipelineRun from them.

func New

func New(scmClient git.SCM, pipelineClient pipelineclientset.Interface, namespace string, l logger.Logger) *Handler

New creates and returns a new Handler.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http.Handler interface.

type ParamBinding

type ParamBinding struct {
	Name       string `yaml:"name"`
	Expression string `yaml:"expression"`
}

ParamBinding represents a name and CEL expression that's used when generating a PipelineRun from the spec.

These are converted to Params, and added to the list of params already provided by the PipelineRunSpec.

type PipelineDefinition

type PipelineDefinition struct {
	Filter          string                     `yaml:"expression"`
	ParamBindings   []ParamBinding             `yaml:"param_bindings"`
	PipelineRunSpec pipelinev1.PipelineRunSpec `yaml:"pipeline_run_spec"`
}

PipelineDefinition represents the YAML that defines a PipelineRun when handing events.

func Parse

func Parse(in io.Reader) (*PipelineDefinition, error)

Parse decodes YAML describing a PipelineDefinition and returns the resource.

Jump to

Keyboard shortcuts

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