Documentation
¶
Overview ¶
Package pipeline provides the defined pipeline types for Vela.
Deprecated: all pipeline types for Vela have been moved to github.com/go-vela/server/compiler/types/pipeline .
This package is frozen.
Index ¶
- Variables
- func BuildWithContext(c context.Context, b *Build) context.Context
- func ContainerWithContext(c context.Context, s *Container) context.Context
- func SecretWithContext(c context.Context, s *Secret) context.Context
- func StageWithContext(c context.Context, s *Stage) context.Context
- type Builddeprecated
- type CancelOptionsdeprecated
- type Containerdeprecated
- type ContainerSlicedeprecated
- type Metadatadeprecated
- type Portdeprecated
- type PortSlicedeprecated
- type RuleDatadeprecated
- type Rulesdeprecated
- type Rulesetdeprecated
- type Ruletypedeprecated
- type Secretdeprecated
- type SecretSlicedeprecated
- type Stagedeprecated
- type StageSlicedeprecated
- type StepSecretdeprecated
- type StepSecretSlicedeprecated
- type Ulimitdeprecated
- type UlimitSlicedeprecated
- type Volumedeprecated
- type VolumeSlicedeprecated
- type Workerdeprecated
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidEngine defines the error type when the // SecretEngine provided to the client is unsupported. ErrInvalidEngine = errors.New("invalid secret engine") // ErrInvalidOrg defines the error type when the // org in key does not equal the name of the organization. ErrInvalidOrg = errors.New("invalid organization in key") // ErrInvalidRepo defines the error type when the // repo in key does not equal the name of the repository. ErrInvalidRepo = errors.New("invalid repository in key") // org in key does not equal the name of the team. ErrInvalidShared = errors.New("invalid team in key") // ErrInvalidPath defines the error type when the // path provided for a type (org, repo, shared) is invalid. ErrInvalidPath = errors.New("invalid secret path") // ErrInvalidName defines the error type when the name // contains restricted characters or is empty. ErrInvalidName = errors.New("invalid secret name") )
Functions ¶
func BuildWithContext ¶
BuildWithContext inserts the Build type to the context.
func ContainerWithContext ¶
ContainerWithContext inserts the Container type to the context.
func SecretWithContext ¶
SecretWithContext inserts the Secret type to the context.
Types ¶
type Build
deprecated
type Build struct { ID string `json:"id,omitempty" yaml:"id,omitempty"` Version string `json:"version,omitempty" yaml:"version,omitempty"` Metadata Metadata `json:"metadata,omitempty" yaml:"metadata,omitempty"` Environment raw.StringSliceMap `json:"environment,omitempty" yaml:"environment,omitempty"` Worker Worker `json:"worker,omitempty" yaml:"worker,omitempty"` Secrets SecretSlice `json:"secrets,omitempty" yaml:"secrets,omitempty"` Services ContainerSlice `json:"services,omitempty" yaml:"services,omitempty"` Stages StageSlice `json:"stages,omitempty" yaml:"stages,omitempty"` Steps ContainerSlice `json:"steps,omitempty" yaml:"steps,omitempty"` }
Build is the pipeline representation of a build for a pipeline.
Deprecated: use Build from github.com/go-vela/server/compiler/types/pipeline instead.
func BuildFromContext ¶
BuildFromContext retrieves the Build type from the context.
func (*Build) Purge ¶
Purge removes the steps, in every stage, that contain a ruleset that do not match the provided ruledata. If all steps from a stage are removed, then the entire stage is removed from the pipeline. If no stages are provided in the pipeline, then the function will remove the steps that have a ruleset that do not match the provided ruledata. If both stages and steps are provided, then an empty pipeline is returned.
func (*Build) Sanitize ¶ added in v0.4.0
Sanitize cleans the fields for every step in each stage so they can be safely executed on the worker. If no stages are provided in the pipeline, then the function will sanitize the fields for every step in the pipeline. The fields are sanitized based off of the provided runtime driver which is setup on every worker. Currently, this function supports the following runtimes:
- Docker
- Kubernetes
type CancelOptions
deprecated
added in
v0.22.0
type CancelOptions struct { Running bool `yaml:"running,omitempty" json:"running,omitempty"` Pending bool `yaml:"pending,omitempty" json:"pending,omitempty"` DefaultBranch bool `yaml:"default_branch,omitempty" json:"default_branch,omitempty"` }
CancelOptions is the pipeline representation of the auto_cancel block for a pipeline.
Deprecated: use CancelOptions from github.com/go-vela/server/compiler/types/pipeline instead.
type Container
deprecated
type Container struct { ID string `json:"id,omitempty" yaml:"id,omitempty"` Commands []string `json:"commands,omitempty" yaml:"commands,omitempty"` Detach bool `json:"detach,omitempty" yaml:"detach,omitempty"` Directory string `json:"directory,omitempty" yaml:"directory,omitempty"` Entrypoint []string `json:"entrypoint,omitempty" yaml:"entrypoint,omitempty"` Environment map[string]string `json:"environment,omitempty" yaml:"environment,omitempty"` ExitCode int `json:"exit_code,omitempty" yaml:"exit_code,omitempty"` Image string `json:"image,omitempty" yaml:"image,omitempty"` Name string `json:"name,omitempty" yaml:"name,omitempty"` Needs []string `json:"needs,omitempty" yaml:"needs,omitempty"` Networks []string `json:"networks,omitempty" yaml:"networks,omitempty"` Number int `json:"number,omitempty" yaml:"number,omitempty"` Ports []string `json:"ports,omitempty" yaml:"ports,omitempty"` Privileged bool `json:"privileged,omitempty" yaml:"privileged,omitempty"` Pull string `json:"pull,omitempty" yaml:"pull,omitempty"` Ruleset Ruleset `json:"ruleset,omitempty" yaml:"ruleset,omitempty"` Secrets StepSecretSlice `json:"secrets,omitempty" yaml:"secrets,omitempty"` Ulimits UlimitSlice `json:"ulimits,omitempty" yaml:"ulimits,omitempty"` Volumes VolumeSlice `json:"volumes,omitempty" yaml:"volumes,omitempty"` User string `json:"user,omitempty" yaml:"user,omitempty"` ReportAs string `json:"report_as,omitempty" yaml:"report_as,omitempty"` IDRequest string `json:"id_request,omitempty" yaml:"id_request,omitempty"` }
Container is the pipeline representation of a Container in a pipeline.
Deprecated: use Container from github.com/go-vela/server/compiler/types/pipeline instead.
func ContainerFromContext ¶
ContainerFromContext retrieves the container type from the context.
func (*Container) Execute ¶ added in v0.4.2
Execute returns true when the provided ruledata matches the conditions when we should be running the container on the worker.
func (*Container) MergeEnv ¶ added in v0.7.3
MergeEnv takes a list of environment variables and attempts to set them in the container environment. If the environment variable already exists in the container, then this will overwrite the existing environment variable.
func (*Container) Sanitize ¶ added in v0.1.4
Sanitize cleans the fields for every step in the pipeline so they can be safely executed on the worker. The fields are sanitized based off of the provided runtime driver which is setup on every worker. Currently, this function supports the following runtimes:
- Docker
- Kubernetes
func (*Container) Substitute ¶ added in v0.7.0
Substitute replaces every reference (${VAR} or $${VAR}) to an environment variable in the container configuration with the corresponding value for that environment variable.
type ContainerSlice
deprecated
type ContainerSlice []*Container
ContainerSlice is the pipeline representation of the Containers block for a pipeline.
Deprecated: use ContainerSlice from github.com/go-vela/server/compiler/types/pipeline instead.
func (*ContainerSlice) Purge ¶
func (c *ContainerSlice) Purge(r *RuleData) (*ContainerSlice, error)
Purge removes the Containers that have a ruleset that do not match the provided ruledata.
func (*ContainerSlice) Sanitize ¶ added in v0.4.0
func (c *ContainerSlice) Sanitize(driver string) *ContainerSlice
Sanitize cleans the fields for every step in the pipeline so they can be safely executed on the worker. The fields are sanitized based off of the provided runtime driver which is setup on every worker. Currently, this function supports the following runtimes:
- Docker
- Kubernetes
type Metadata
deprecated
type Metadata struct { Template bool `json:"template,omitempty" yaml:"template,omitempty"` Clone bool `json:"clone,omitempty" yaml:"clone,omitempty"` Environment []string `json:"environment,omitempty" yaml:"environment,omitempty"` AutoCancel *CancelOptions `json:"auto_cancel,omitempty" yaml:"auto_cancel,omitempty"` }
Metadata is the pipeline representation of the metadata block for a pipeline.
Deprecated: use Metadata from github.com/go-vela/server/compiler/types/pipeline instead.
type Port
deprecated
type Port struct { Port int `json:"port,omitempty" yaml:"port,omitempty"` Host int `json:"host,omitempty" yaml:"host,omitempty"` Protocol string `json:"protocol,omitempty" yaml:"protocol,omitempty"` }
Port is the pipeline representation of a port for a step in a pipeline.
Deprecated: use Port from github.com/go-vela/server/compiler/types/pipeline instead.
type RuleData
deprecated
type RuleData struct { Branch string `json:"branch,omitempty" yaml:"branch,omitempty"` Comment string `json:"comment,omitempty" yaml:"comment,omitempty"` Event string `json:"event,omitempty" yaml:"event,omitempty"` Path []string `json:"path,omitempty" yaml:"path,omitempty"` Repo string `json:"repo,omitempty" yaml:"repo,omitempty"` Status string `json:"status,omitempty" yaml:"status,omitempty"` Tag string `json:"tag,omitempty" yaml:"tag,omitempty"` Target string `json:"target,omitempty" yaml:"target,omitempty"` Label []string `json:"label,omitempty" yaml:"label,omitempty"` Instance string `json:"instance,omitempty" yaml:"instance,omitempty"` Parallel bool `json:"-" yaml:"-"` }
RuleData is the data to check our ruleset against for a step in a pipeline.
Deprecated: use RuleData from github.com/go-vela/server/compiler/types/pipeline instead.
type Rules
deprecated
type Rules struct { Branch Ruletype `json:"branch,omitempty" yaml:"branch,omitempty"` Comment Ruletype `json:"comment,omitempty" yaml:"comment,omitempty"` Event Ruletype `json:"event,omitempty" yaml:"event,omitempty"` Path Ruletype `json:"path,omitempty" yaml:"path,omitempty"` Repo Ruletype `json:"repo,omitempty" yaml:"repo,omitempty"` Status Ruletype `json:"status,omitempty" yaml:"status,omitempty"` Tag Ruletype `json:"tag,omitempty" yaml:"tag,omitempty"` Target Ruletype `json:"target,omitempty" yaml:"target,omitempty"` Label Ruletype `json:"label,omitempty" yaml:"label,omitempty"` Instance Ruletype `json:"instance,omitempty" yaml:"instance,omitempty"` Parallel bool `json:"-" yaml:"-"` }
Rules is the pipeline representation of the ruletypes from a ruleset block for a step in a pipeline.
Deprecated: use Rules from github.com/go-vela/server/compiler/types/pipeline instead.
func (*Rules) Match ¶
Match returns true for the `or` operator when one of the ruletypes from the rules match the provided ruledata. Match returns true for the `and` operator when all of the ruletypes from the rules match the provided ruledata. For both operators, when none of the ruletypes from the rules match the provided ruledata, the function returns false.
type Ruleset
deprecated
type Ruleset struct { If Rules `json:"if,omitempty" yaml:"if,omitempty"` Unless Rules `json:"unless,omitempty" yaml:"unless,omitempty"` Matcher string `json:"matcher,omitempty" yaml:"matcher,omitempty"` Operator string `json:"operator,omitempty" yaml:"operator,omitempty"` Continue bool `json:"continue,omitempty" yaml:"continue,omitempty"` }
Ruleset is the pipeline representation of a ruleset block for a step in a pipeline.
Deprecated: use Ruleset from github.com/go-vela/server/compiler/types/pipeline instead.
type Ruletype
deprecated
type Ruletype []string
Ruletype is the pipeline representation of an element for a ruleset block for a step in a pipeline.
Deprecated: use Ruletype from github.com/go-vela/server/compiler/types/pipeline instead.
func (*Ruletype) MatchMultiple ¶ added in v0.24.0
MatchMultiple returns true when the provided ruletype matches the provided ruledata. When the provided ruletype is empty, the function returns true for the `and` operator and false for the `or` operator.
func (*Ruletype) MatchSingle ¶ added in v0.24.0
MatchSingle returns true when the provided ruletype matches the provided ruledata. When the provided ruletype is empty, the function returns true for the `and` operator and false for the `or` operator.
type Secret
deprecated
type Secret struct { Name string `json:"name,omitempty" yaml:"name,omitempty"` Value string `json:"value,omitempty" yaml:"value,omitempty"` Key string `json:"key,omitempty" yaml:"key,omitempty"` Engine string `json:"engine,omitempty" yaml:"engine,omitempty"` Type string `json:"type,omitempty" yaml:"type,omitempty"` Origin *Container `json:"origin,omitempty" yaml:"origin,omitempty"` Pull string `json:"pull,omitempty" yaml:"pull,omitempty"` }
Secret is the pipeline representation of a secret from the secrets block for a pipeline.
Deprecated: use Secret from github.com/go-vela/server/compiler/types/pipeline instead.
func SecretFromContext ¶
SecretFromContext retrieves the Secret type from the context.
func (*Secret) ParseOrg ¶ added in v0.5.0
ParseOrg returns the parts (org, key) of the secret path when the secret is valid for a given organization.
type SecretSlice
deprecated
type SecretSlice []*Secret
SecretSlice is the pipeline representation of the secrets block for a pipeline.
Deprecated: use SecretSlice from github.com/go-vela/server/compiler/types/pipeline instead.
func (*SecretSlice) Purge ¶ added in v0.5.0
func (s *SecretSlice) Purge(r *RuleData) (*SecretSlice, error)
Purge removes the secrets that have a ruleset that do not match the provided ruledata.
type Stage
deprecated
type Stage struct { Done chan error `json:"-" yaml:"-"` Environment map[string]string `json:"environment,omitempty" yaml:"environment,omitempty"` Name string `json:"name,omitempty" yaml:"name,omitempty"` Needs []string `json:"needs,omitempty" yaml:"needs,omitempty"` Independent bool `json:"independent,omitempty" yaml:"independent,omitempty"` Steps ContainerSlice `json:"steps,omitempty" yaml:"steps,omitempty"` }
Stage is the pipeline representation of a stage in a pipeline.
Deprecated: use Stage from github.com/go-vela/server/compiler/types/pipeline instead.
func StageFromContext ¶
StageFromContext retrieves the Stage type from the context.
type StageSlice
deprecated
type StageSlice []*Stage
StageSlice is the pipeline representation of the stages block for a pipeline.
Deprecated: use StageSlice from github.com/go-vela/server/compiler/types/pipeline instead.
func (*StageSlice) Purge ¶
func (s *StageSlice) Purge(r *RuleData) (*StageSlice, error)
Purge removes the steps, from the stages, that have a ruleset that do not match the provided ruledata. If all steps from a stage are removed, then the entire stage is removed from the pipeline.
func (*StageSlice) Sanitize ¶ added in v0.4.0
func (s *StageSlice) Sanitize(driver string) *StageSlice
Sanitize cleans the fields for every step in each stage so they can be safely executed on the worker. The fields are sanitized based off of the provided runtime driver which is setup on every worker. Currently, this function supports the following runtimes:
- Docker
- Kubernetes
type StepSecret
deprecated
type StepSecret struct { Source string `json:"source,omitempty" yaml:"source,omitempty"` Target string `json:"target,omitempty" yaml:"target,omitempty"` }
StepSecret is the pipeline representation of a secret from a secrets block for a step in a pipeline.
Deprecated: use StepSecret from github.com/go-vela/server/compiler/types/pipeline instead.
type StepSecretSlice
deprecated
type StepSecretSlice []*StepSecret
StepSecretSlice is the pipeline representation of the secrets block for a step in a pipeline.
Deprecated: use StepSecretSlice from github.com/go-vela/server/compiler/types/pipeline instead.
type Ulimit
deprecated
type Ulimit struct { Name string `json:"name,omitempty" yaml:"name,omitempty"` Soft int64 `json:"soft,omitempty" yaml:"soft,omitempty"` Hard int64 `json:"hard,omitempty" yaml:"hard,omitempty"` }
Ulimit is the pipeline representation of a ulimit from the ulimits block for a step in a pipeline.
Deprecated: use Ulimit from github.com/go-vela/server/compiler/types/pipeline instead.
type UlimitSlice
deprecated
type UlimitSlice []*Ulimit
UlimitSlice is the pipeline representation of the ulimits block for a step in a pipeline.
Deprecated: use UlimitSlice from github.com/go-vela/server/compiler/types/pipeline instead.
type Volume
deprecated
type Volume struct { Source string `json:"source,omitempty" yaml:"source,omitempty"` Destination string `json:"destination,omitempty" yaml:"destination,omitempty"` AccessMode string `json:"access_mode,omitempty" yaml:"access_mode,omitempty"` }
Volume is the pipeline representation of a volume from a volumes block for a step in a pipeline.
Deprecated: use Volume from github.com/go-vela/server/compiler/types/pipeline instead.
type VolumeSlice
deprecated
type VolumeSlice []*Volume
VolumeSlice is the pipeline representation of the volumes block for a step in a pipeline.
Deprecated: use VolumeSlice from github.com/go-vela/server/compiler/types/pipeline instead.
type Worker
deprecated
added in
v0.2.0
type Worker struct { Flavor string `json:"flavor,omitempty" yaml:"flavor,omitempty"` Platform string `json:"platform,omitempty" yaml:"platform,omitempty"` }
Worker is the yaml representation of the worker block for a pipeline.
Deprecated: use Worker from github.com/go-vela/server/compiler/types/pipeline instead.