ci

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultStage = "default"

DefaultStage is the stage into which steps that have no stage are placed during the parsing process.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifacts

type Artifacts struct {
	Paths []string `json:"paths,omitempty"`
}

Artifacts represents a set of paths that should be treated as artifacts and archived in some way.

type Pipeline

type Pipeline struct {
	Image        string            `json:"image,omitempty"`
	Variables    map[string]string `json:"variables,omitempty"`
	BeforeScript []string          `json:"before_script,omitempty"`
	AfterScript  []string          `json:"after_script,omitempty"`
	Stages       []string          `json:"stages,omitempty"`
	Tasks        []*Task           `json:"tasks,omitempty"`
	TektonConfig *TektonConfig     `json:"tekton,omitempty"`
}

Pipeline represents the parsed Pipeline.

func Parse

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

Parse decodes YAML describing a CI pipeline and returns the configuration.

Decoded tasks are given put into the "default" Stage.

If no explicit ordering of the Stages is provided, they're subject to hash ordering.

func (Pipeline) Task

func (c Pipeline) Task(n string) *Task

Task returns the named job or nil if it exists

func (Pipeline) TasksForStage

func (c Pipeline) TasksForStage(n string) []string

TasksForStage returns the named jobs for a specific stage.

type Rule

type Rule struct {
	If   string `json:"if"`
	When string `json:"when"`
}

Rule represents a rule that determines when a PipelineRun is triggered.

type Task

type Task struct {
	Name      string      `json:"name"`
	Stage     string      `json:"stage,omitempty"`
	Tekton    *TektonTask `json:"tekton,omitempty"`
	Script    []string    `json:"script,omitempty"`
	Artifacts Artifacts   `json:"artifacts,omitempty"`
	Rules     []Rule      `json:"rules,omitempty"`
}

Task represents the parsed Task from the Pipeline.

type TektonConfig

type TektonConfig struct {
	ServiceAccountName string `json:"serviceAccountName"`
}

TektonConfig provides global configuration for the DSL script specifically for Tekton.

type TektonTask

type TektonTask struct {
	// Used to generate a matrix of configurations for parallel jobs.
	Jobs    []map[string]string `json:"jobs,omitempty"`
	TaskRef string              `json:"taskRef,omitempty"`
	Params  []TektonTaskParam   `json:"params,omitempty"`
	Image   string              `json:"image,omitempty"`
}

TektonTask is an extension for executing Tekton Tasks.

type TektonTaskParam

type TektonTaskParam struct {
	Name       string `json:"name"`
	Expression string `json:"expression"`
}

TektonTaskParam is passed into a Tekton task.

Jump to

Keyboard shortcuts

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