Documentation
¶
Overview ¶
Package native provides the ability for Vela to reconstruct a yaml configuration into an executable pipeline.
Usage:
import "github.com/go-vela/server/compiler/native"
Index ¶
- func ParseBytes(data []byte) (*yaml.Build, []byte, []string, error)
- func ParseFile(f *os.File) (*yaml.Build, []byte, []string, error)
- func ParseFileRaw(f *os.File) (string, error)
- func ParsePath(p string) (*yaml.Build, []byte, []string, error)
- func ParsePathRaw(p string) (string, error)
- func ParseReader(r io.Reader) (*yaml.Build, []byte, []string, error)
- func ParseReaderRaw(r io.Reader) (string, error)
- func ParseString(s string) (*yaml.Build, []byte, []string, error)
- type Client
- func (c *Client) CloneStage(p *yaml.Build) (*yaml.Build, error)
- func (c *Client) CloneStep(p *yaml.Build) (*yaml.Build, error)
- func (c *Client) Compile(ctx context.Context, v interface{}) (*pipeline.Build, *api.Pipeline, error)
- func (c *Client) CompileLite(ctx context.Context, v interface{}, ruleData *pipeline.RuleData, ...) (*yaml.Build, *api.Pipeline, error)
- func (c *Client) Duplicate() compiler.Engine
- func (c *Client) EnvironmentBuild() map[string]string
- func (c *Client) EnvironmentSecrets(s yaml.SecretSlice, globalEnv raw.StringSliceMap) (yaml.SecretSlice, error)
- func (c *Client) EnvironmentServices(s yaml.ServiceSlice, globalEnv raw.StringSliceMap) (yaml.ServiceSlice, error)
- func (c *Client) EnvironmentStage(s *yaml.Stage, globalEnv raw.StringSliceMap) (*yaml.Stage, error)
- func (c *Client) EnvironmentStages(s yaml.StageSlice, globalEnv raw.StringSliceMap) (yaml.StageSlice, error)
- func (c *Client) EnvironmentStep(s *yaml.Step, stageEnv raw.StringSliceMap) (*yaml.Step, error)
- func (c *Client) EnvironmentSteps(s yaml.StepSlice, stageEnv raw.StringSliceMap) (yaml.StepSlice, error)
- func (c *Client) ExpandDeployment(ctx context.Context, b *yaml.Build, tmpls map[string]*yaml.Template) (*yaml.Build, error)
- func (c *Client) ExpandStages(ctx context.Context, s *yaml.Build, tmpls map[string]*yaml.Template, ...) (*yaml.Build, []string, error)
- func (c *Client) ExpandSteps(ctx context.Context, s *yaml.Build, tmpls map[string]*yaml.Template, ...) (*yaml.Build, []string, error)
- func (c *Client) GetSettings() settings.Compiler
- func (c *Client) InitStage(p *yaml.Build) (*yaml.Build, error)
- func (c *Client) InitStep(p *yaml.Build) (*yaml.Build, error)
- func (c *Client) Parse(v interface{}, pipelineType string, template *yaml.Template) (*yaml.Build, []byte, []string, error)
- func (c *Client) ParseRaw(v interface{}) (string, error)
- func (c *Client) ScriptStages(s yaml.StageSlice) (yaml.StageSlice, error)
- func (c *Client) ScriptSteps(s yaml.StepSlice) (yaml.StepSlice, error)
- func (c *Client) SetSettings(s *settings.Platform)
- func (c *Client) SubstituteStages(s types.StageSlice) (types.StageSlice, error)
- func (c *Client) SubstituteSteps(s types.StepSlice) (types.StepSlice, error)
- func (c *Client) TransformStages(r *pipeline.RuleData, p *yaml.Build) (*pipeline.Build, error)
- func (c *Client) TransformSteps(r *pipeline.RuleData, p *yaml.Build) (*pipeline.Build, error)
- func (c *Client) ValidatePipeline(p *pipeline.Build) error
- func (c *Client) ValidateYAML(p *yaml.Build) error
- func (c *Client) WithBuild(b *api.Build) compiler.Engine
- func (c *Client) WithComment(cmt string) compiler.Engine
- func (c *Client) WithCommit(cmt string) compiler.Engine
- func (c *Client) WithDatabase(db database.Interface) compiler.Engine
- func (c *Client) WithFiles(f []string) compiler.Engine
- func (c *Client) WithLabels(labels []string) compiler.Engine
- func (c *Client) WithLocal(local bool) compiler.Engine
- func (c *Client) WithLocalTemplates(templates []string) compiler.Engine
- func (c *Client) WithMetadata(m *internal.Metadata) compiler.Engine
- func (c *Client) WithNetrc(n string) compiler.Engine
- func (c *Client) WithPrivateGitHub(ctx context.Context, url, token string) compiler.Engine
- func (c *Client) WithRepo(r *api.Repo) compiler.Engine
- func (c *Client) WithSCM(_scm scm.Service) compiler.Engine
- func (c *Client) WithUser(u *api.User) compiler.Engine
- type ModificationConfig
- type ModifyRequest
- type ModifyResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseBytes ¶
ParseBytes converts a byte slice to a yaml configuration.
func ParseFileRaw ¶
ParseFileRaw converts an os.File into a string.
func ParsePathRaw ¶
ParsePathRaw converts a file path into a yaml configuration.
func ParseReader ¶
ParseReader converts an io.Reader into a yaml configuration.
func ParseReaderRaw ¶
ParseReaderRaw converts an io.Reader into a yaml configuration.
Types ¶
type Client ¶ added in v0.27.0
type Client struct { Github registry.Service PrivateGithub registry.Service UsePrivateGithub bool ModificationService ModificationConfig TemplateCache map[string][]byte settings.Compiler // contains filtered or unexported fields }
func FromCLICommand ¶ added in v0.27.0
FromCLICommand returns a Pipeline implementation that integrates with the supported registries.
func (*Client) CloneStage ¶ added in v0.27.0
CloneStage injects the clone stage process into a yaml configuration.
func (*Client) CloneStep ¶ added in v0.27.0
CloneStep injects the clone step process into a yaml configuration.
func (*Client) Compile ¶ added in v0.27.0
func (c *Client) Compile(ctx context.Context, v interface{}) (*pipeline.Build, *api.Pipeline, error)
Compile produces an executable pipeline from a yaml configuration.
func (*Client) CompileLite ¶ added in v0.27.0
func (c *Client) CompileLite(ctx context.Context, v interface{}, ruleData *pipeline.RuleData, substitute bool) (*yaml.Build, *api.Pipeline, error)
CompileLite produces a partial of an executable pipeline from a yaml configuration.
func (*Client) EnvironmentBuild ¶ added in v0.27.0
EnvironmentBuild injects environment variables for the build in a yaml configuration.
func (*Client) EnvironmentSecrets ¶ added in v0.27.0
func (c *Client) EnvironmentSecrets(s yaml.SecretSlice, globalEnv raw.StringSliceMap) (yaml.SecretSlice, error)
EnvironmentSecrets injects environment variables for each secret plugin in a yaml configuration.
func (*Client) EnvironmentServices ¶ added in v0.27.0
func (c *Client) EnvironmentServices(s yaml.ServiceSlice, globalEnv raw.StringSliceMap) (yaml.ServiceSlice, error)
EnvironmentServices injects environment variables for each service in a yaml configuration.
func (*Client) EnvironmentStage ¶ added in v0.27.0
EnvironmentStage injects environment variables for each stage in a yaml configuration.
func (*Client) EnvironmentStages ¶ added in v0.27.0
func (c *Client) EnvironmentStages(s yaml.StageSlice, globalEnv raw.StringSliceMap) (yaml.StageSlice, error)
EnvironmentStages injects environment variables for each stage in a yaml configuration.
func (*Client) EnvironmentStep ¶ added in v0.27.0
EnvironmentStep injects environment variables a single step in a yaml configuration.
func (*Client) EnvironmentSteps ¶ added in v0.27.0
func (c *Client) EnvironmentSteps(s yaml.StepSlice, stageEnv raw.StringSliceMap) (yaml.StepSlice, error)
EnvironmentSteps injects environment variables for each step in a stage for the yaml configuration.
func (*Client) ExpandDeployment ¶ added in v0.27.0
func (c *Client) ExpandDeployment(ctx context.Context, b *yaml.Build, tmpls map[string]*yaml.Template) (*yaml.Build, error)
ExpandDeployment injects the template for a templated deployment config in a yaml configuration.
func (*Client) ExpandStages ¶ added in v0.27.0
func (c *Client) ExpandStages(ctx context.Context, s *yaml.Build, tmpls map[string]*yaml.Template, r *pipeline.RuleData, warnings []string) (*yaml.Build, []string, error)
ExpandStages injects the template for each templated step in every stage in a yaml configuration.
func (*Client) ExpandSteps ¶ added in v0.27.0
func (c *Client) ExpandSteps(ctx context.Context, s *yaml.Build, tmpls map[string]*yaml.Template, r *pipeline.RuleData, warnings []string, depth int) (*yaml.Build, []string, error)
ExpandSteps injects the template for each templated step in a yaml configuration.
func (*Client) GetSettings ¶ added in v0.27.0
GetSettings retrieves the api settings type.
func (*Client) InitStage ¶ added in v0.27.0
InitStage injects the init stage process into a yaml configuration.
func (*Client) InitStep ¶ added in v0.27.0
InitStep injects the init step process into a yaml configuration.
func (*Client) Parse ¶ added in v0.27.0
func (c *Client) Parse(v interface{}, pipelineType string, template *yaml.Template) (*yaml.Build, []byte, []string, error)
Parse converts an object to a yaml configuration.
func (*Client) ScriptStages ¶ added in v0.27.0
func (c *Client) ScriptStages(s yaml.StageSlice) (yaml.StageSlice, error)
ScriptStages injects the script for each step in every stage in a yaml configuration.
func (*Client) ScriptSteps ¶ added in v0.27.0
ScriptSteps injects the script for each step in a yaml configuration.
func (*Client) SetSettings ¶ added in v0.27.0
SetSettings sets the api settings type.
func (*Client) SubstituteStages ¶ added in v0.27.0
func (c *Client) SubstituteStages(s types.StageSlice) (types.StageSlice, error)
SubstituteStages replaces every declared environment variable with its corresponding value for each step in every stage in a yaml configuration.
func (*Client) SubstituteSteps ¶ added in v0.27.0
SubstituteSteps replaces every declared environment variable with its corresponding value for each step in a yaml configuration.
func (*Client) TransformStages ¶ added in v0.27.0
TransformStages converts a yaml configuration with stages into an executable pipeline.
func (*Client) TransformSteps ¶ added in v0.27.0
TransformSteps converts a yaml configuration with steps into an executable pipeline.
func (*Client) ValidatePipeline ¶ added in v0.27.0
ValidatePipeline verifies the final pipeline configuration is valid.
func (*Client) ValidateYAML ¶ added in v0.27.0
ValidateYAML verifies the yaml configuration is valid.
func (*Client) WithComment ¶ added in v0.27.0
WithComment sets the comment in the Engine.
func (*Client) WithCommit ¶ added in v0.27.0
WithCommit sets the comment in the Engine.
func (*Client) WithDatabase ¶ added in v0.27.0
WithDatabase sets the database in the Engine.
func (*Client) WithLabels ¶ added in v0.27.0
WithLabels sets the label(s) in the Engine.
func (*Client) WithLocal ¶ added in v0.27.0
WithLocal sets the compiler metadata type in the Engine.
func (*Client) WithLocalTemplates ¶ added in v0.27.0
WithLocalTemplates sets the compiler local templates in the Engine.
func (*Client) WithMetadata ¶ added in v0.27.0
WithMetadata sets the compiler metadata type in the Engine.
func (*Client) WithPrivateGitHub ¶ added in v0.27.0
WithPrivateGitHub sets the private github client in the Engine.
type ModificationConfig ¶
type ModifyRequest ¶
type ModifyRequest struct { Pipeline string `json:"pipeline,omitempty"` Build int64 `json:"build,omitempty"` Repo string `json:"repo,omitempty"` Org string `json:"org,omitempty"` User string `json:"user,omitempty"` }
ModifyRequest contains the payload passed to the modification endpoint.
type ModifyResponse ¶
type ModifyResponse struct {
Pipeline string `json:"pipeline,omitempty"`
}
ModifyResponse contains the payload returned by the modification endpoint.