Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertPipelineToPipelineRun(from *tektonv1beta1.Pipeline, message string, defaultValues *DefaultValues) (*tektonv1beta1.PipelineRun, error)
- func ConvertTaskRunToPipelineRun(from *tektonv1beta1.TaskRun, message string, defaultValues *DefaultValues) (*tektonv1beta1.PipelineRun, error)
- func ConvertTaskToPipelineRun(from *tektonv1beta1.Task, message string, defaultValues *DefaultValues) (*tektonv1beta1.PipelineRun, error)
- func DefaultPipelineParameters(prs *v1beta1.PipelineRun) (*v1beta1.PipelineRun, error)
- func Generate(fileBrowser filebrowser.Interface, sharedConfig *config.Config, ...) (*config.Config, *plugins.Configuration, error)
- func IsScmNotFound(err error) bool
- func LoadTektonResourceAsPipelineRun(resolver *UsesResolver, data []byte) (*tektonv1beta1.PipelineRun, error)
- func LoadTriggerConfig(fileBrowser filebrowser.Interface, ownerName string, repoName string, ...) (*triggerconfig.Config, error)
- func MergeTriggers(cfg *config.Config, pluginCfg *plugins.Configuration, ...) (bool, error)
- func OverrideEnv(from []v1.EnvVar, overrides []v1.EnvVar) []v1.EnvVar
- func OverrideEnvFrom(from []v1.EnvFromSource, overrides []v1.EnvFromSource) []v1.EnvFromSource
- func OverrideStep(step *tektonv1beta1.Step, override *tektonv1beta1.Step)
- func OverrideVolumeMounts(from []v1.VolumeMount, overrides []v1.VolumeMount) []v1.VolumeMount
- func ToParamSpecs(params []tektonv1beta1.Param) []tektonv1beta1.ParamSpec
- func ToParams(params []tektonv1beta1.ParamSpec) []tektonv1beta1.Param
- func ToPipelineInput(from tektonv1beta1.TaskResource) tektonv1beta1.PipelineTaskInputResource
- func ToPipelineInputs(inputs []tektonv1beta1.TaskResource) []tektonv1beta1.PipelineTaskInputResource
- func ToPipelineOutput(from tektonv1beta1.TaskResource) tektonv1beta1.PipelineTaskOutputResource
- func ToPipelineOutputs(inputs []tektonv1beta1.TaskResource) []tektonv1beta1.PipelineTaskOutputResource
- func ToPipelineResources(resources *tektonv1beta1.TaskResources) *tektonv1beta1.PipelineTaskResources
- func ToPipelineWorkspaceDeclaration(from tektonv1beta1.WorkspaceDeclaration) tektonv1beta1.PipelineWorkspaceDeclaration
- func ToPipelineWorkspaceDeclarations(workspaces []tektonv1beta1.WorkspaceDeclaration) []tektonv1beta1.PipelineWorkspaceDeclaration
- func ToWorkspaceBinding(from tektonv1beta1.WorkspaceDeclaration) tektonv1beta1.WorkspaceBinding
- func ToWorkspaceBindings(workspaces []tektonv1beta1.WorkspaceDeclaration) []tektonv1beta1.WorkspaceBinding
- func ToWorkspacePipelineTaskBinding(from tektonv1beta1.WorkspaceBinding) tektonv1beta1.WorkspacePipelineTaskBinding
- func ToWorkspacePipelineTaskBindings(workspaces []tektonv1beta1.WorkspaceBinding) []tektonv1beta1.WorkspacePipelineTaskBinding
- func ToWorkspacePipelineTaskBindingsFromDeclaration(from tektonv1beta1.WorkspaceDeclaration) tektonv1beta1.WorkspacePipelineTaskBinding
- func ToWorkspacePipelineTaskBindingsFromDeclarations(workspaces []tektonv1beta1.WorkspaceDeclaration) []tektonv1beta1.WorkspacePipelineTaskBinding
- func VersionStreamEnvVar(owner string, repo string) string
- type DefaultValues
- type GitURI
- type UsesResolver
Constants ¶
const ( // TektonAPIVersion the default tekton API version TektonAPIVersion = "tekton.dev/v1beta1" // DefaultParameters the annotation used to disable default parameters DefaultParameters = "lighthouse.jenkins-x.io/defaultParameters" // LoadFileRefPattern the regular expression to match which Pipeline/Task references to load via files LoadFileRefPattern = "lighthouse.jenkins-x.io/loadFileRefs" // PrependStepURL loads the steps from the given URL and prepends them to the given Task PrependStepURL = "lighthouse.jenkins-x.io/prependStepsURL" // AppendStepURL loads the steps from the given URL and appends them to the end of the Task steps AppendStepURL = "lighthouse.jenkins-x.io/appendStepsURL" )
Variables ¶
var ( // VersionStreamVersions allows you to register version stream values of ful repository names in the format // `owner/name` mapping to the version SHA/branch/tag VersionStreamVersions = map[string]string{} )
Functions ¶
func ConvertPipelineToPipelineRun ¶ added in v0.0.858
func ConvertPipelineToPipelineRun(from *tektonv1beta1.Pipeline, message string, defaultValues *DefaultValues) (*tektonv1beta1.PipelineRun, error)
ConvertPipelineToPipelineRun converts the Pipeline to a PipelineRun
func ConvertTaskRunToPipelineRun ¶ added in v0.0.858
func ConvertTaskRunToPipelineRun(from *tektonv1beta1.TaskRun, message string, defaultValues *DefaultValues) (*tektonv1beta1.PipelineRun, error)
ConvertTaskRunToPipelineRun converts the TaskRun to a PipelineRun
func ConvertTaskToPipelineRun ¶ added in v0.0.858
func ConvertTaskToPipelineRun(from *tektonv1beta1.Task, message string, defaultValues *DefaultValues) (*tektonv1beta1.PipelineRun, error)
ConvertTaskToPipelineRun converts the Task to a PipelineRun
func DefaultPipelineParameters ¶ added in v0.0.866
func DefaultPipelineParameters(prs *v1beta1.PipelineRun) (*v1beta1.PipelineRun, error)
DefaultPipelineParameters defaults the parameter specs and parameter values from lighthouse onto the PipelineRun and its nested PipelineSpec and Tasks
func Generate ¶
func Generate(fileBrowser filebrowser.Interface, sharedConfig *config.Config, sharedPlugins *plugins.Configuration, owner, repo, eventRef string) (*config.Config, *plugins.Configuration, error)
Generate generates the in repository config if enabled for this repository otherwise return the shared config
func IsScmNotFound ¶ added in v0.0.858
IsScmNotFound returns true if the error is a not found error
func LoadTektonResourceAsPipelineRun ¶ added in v0.0.858
func LoadTektonResourceAsPipelineRun(resolver *UsesResolver, data []byte) (*tektonv1beta1.PipelineRun, error)
LoadTektonResourceAsPipelineRun loads a PipelineRun, Pipeline, Task or TaskRun and convert it to a PipelineRun if necessary
func LoadTriggerConfig ¶
func LoadTriggerConfig(fileBrowser filebrowser.Interface, ownerName string, repoName string, sha string) (*triggerconfig.Config, error)
LoadTriggerConfig loads the `lighthouse.yaml` configuration files in the repository
func MergeTriggers ¶
func MergeTriggers(cfg *config.Config, pluginCfg *plugins.Configuration, fileBrowser filebrowser.Interface, ownerName string, repoName string, sha string) (bool, error)
MergeTriggers merges the configuration with any `lighthouse.yaml` files in the repository
func OverrideEnv ¶ added in v0.0.918
OverrideEnv override either replaces or adds the given env vars
func OverrideEnvFrom ¶ added in v0.0.918
func OverrideEnvFrom(from []v1.EnvFromSource, overrides []v1.EnvFromSource) []v1.EnvFromSource
OverrideEnvFrom override either replaces or adds the given env froms
func OverrideStep ¶ added in v0.0.918
func OverrideStep(step *tektonv1beta1.Step, override *tektonv1beta1.Step)
OverrideStep overrides the step with the given overrides
func OverrideVolumeMounts ¶ added in v0.0.918
func OverrideVolumeMounts(from []v1.VolumeMount, overrides []v1.VolumeMount) []v1.VolumeMount
OverrideVolumeMounts override either replaces or adds the given volume mounts
func ToParamSpecs ¶ added in v0.0.858
func ToParamSpecs(params []tektonv1beta1.Param) []tektonv1beta1.ParamSpec
ToParamSpecs generates param specs from the params
func ToParams ¶ added in v0.0.858
func ToParams(params []tektonv1beta1.ParamSpec) []tektonv1beta1.Param
ToParams converts the param specs to params
func ToPipelineInput ¶ added in v0.0.858
func ToPipelineInput(from tektonv1beta1.TaskResource) tektonv1beta1.PipelineTaskInputResource
ToPipelineInput converts the task resource into pipeline inputs
func ToPipelineInputs ¶ added in v0.0.858
func ToPipelineInputs(inputs []tektonv1beta1.TaskResource) []tektonv1beta1.PipelineTaskInputResource
ToPipelineInputs converts the task resources into pipeline inputs
func ToPipelineOutput ¶ added in v0.0.858
func ToPipelineOutput(from tektonv1beta1.TaskResource) tektonv1beta1.PipelineTaskOutputResource
ToPipelineOutput converts the task resource into pipeline outputs
func ToPipelineOutputs ¶ added in v0.0.858
func ToPipelineOutputs(inputs []tektonv1beta1.TaskResource) []tektonv1beta1.PipelineTaskOutputResource
ToPipelineOutputs converts the task resources into pipeline outputs
func ToPipelineResources ¶ added in v0.0.858
func ToPipelineResources(resources *tektonv1beta1.TaskResources) *tektonv1beta1.PipelineTaskResources
ToPipelineResources converts the task resources to piepline resources
func ToPipelineWorkspaceDeclaration ¶ added in v0.0.858
func ToPipelineWorkspaceDeclaration(from tektonv1beta1.WorkspaceDeclaration) tektonv1beta1.PipelineWorkspaceDeclaration
ToPipelineWorkspaceDeclaration converts the workspace declaration to a pipeline workspace declaration
func ToPipelineWorkspaceDeclarations ¶ added in v0.0.858
func ToPipelineWorkspaceDeclarations(workspaces []tektonv1beta1.WorkspaceDeclaration) []tektonv1beta1.PipelineWorkspaceDeclaration
ToPipelineWorkspaceDeclarations converts the workspace declarations to pipeline workspace declarations
func ToWorkspaceBinding ¶ added in v0.0.858
func ToWorkspaceBinding(from tektonv1beta1.WorkspaceDeclaration) tektonv1beta1.WorkspaceBinding
ToWorkspaceBinding converts the workspace declaration to a workspaces binding
func ToWorkspaceBindings ¶ added in v0.0.858
func ToWorkspaceBindings(workspaces []tektonv1beta1.WorkspaceDeclaration) []tektonv1beta1.WorkspaceBinding
ToWorkspaceBindings converts the workspace declarations to workspaces bindings
func ToWorkspacePipelineTaskBinding ¶ added in v0.0.858
func ToWorkspacePipelineTaskBinding(from tektonv1beta1.WorkspaceBinding) tektonv1beta1.WorkspacePipelineTaskBinding
ToWorkspacePipelineTaskBinding converts the workspace binding to a pipeline task binding
func ToWorkspacePipelineTaskBindings ¶ added in v0.0.858
func ToWorkspacePipelineTaskBindings(workspaces []tektonv1beta1.WorkspaceBinding) []tektonv1beta1.WorkspacePipelineTaskBinding
ToWorkspacePipelineTaskBindings converts the workspace bindings to pipeline task bindings
func ToWorkspacePipelineTaskBindingsFromDeclaration ¶ added in v0.0.858
func ToWorkspacePipelineTaskBindingsFromDeclaration(from tektonv1beta1.WorkspaceDeclaration) tektonv1beta1.WorkspacePipelineTaskBinding
ToWorkspacePipelineTaskBindingsFromDeclaration converts the workspace declaration to a pipeline task binding
func ToWorkspacePipelineTaskBindingsFromDeclarations ¶ added in v0.0.858
func ToWorkspacePipelineTaskBindingsFromDeclarations(workspaces []tektonv1beta1.WorkspaceDeclaration) []tektonv1beta1.WorkspacePipelineTaskBinding
ToWorkspacePipelineTaskBindingsFromDeclarations converts the workspace declarations to pipeline task bindings
func VersionStreamEnvVar ¶ added in v0.0.918
VersionStreamEnvVar creates an environment variable name
Types ¶
type DefaultValues ¶ added in v0.0.858
type DefaultValues struct { // ServiceAccountName ServiceAccountName string // Timeout Timeout *metav1.Duration }
DefaultValues default values applied to a PipelineRun if wrapping a Pipeline/Task/TaskRun as a PipelineRun
func NewDefaultValues ¶ added in v0.0.858
func NewDefaultValues() (*DefaultValues, error)
NewDefaultValues creatse a new default values
func (*DefaultValues) Apply ¶ added in v0.0.858
func (v *DefaultValues) Apply(prs *tektonv1beta1.PipelineRun)
Apply adds any default values that are empty in the generated PipelineRun
type GitURI ¶ added in v0.0.918
GitURI the output of parsing Git URIs
func ParseGitURI ¶ added in v0.0.918
ParseGitURI parses git source URIs or returns nil if its not a valid URI
handles strings of the form "owner/repository(/path)@sha"
type UsesResolver ¶ added in v0.0.918
type UsesResolver struct { Client filebrowser.Interface OwnerName string RepoName string SHA string Dir string Message string DefaultValues *DefaultValues LocalFileResolve bool // contains filtered or unexported fields }
UsesResolver resolves the `uses:` URI syntax
func (*UsesResolver) GetData ¶ added in v0.0.918
func (r *UsesResolver) GetData(path string, ignoreNotExist bool) ([]byte, error)
GetData gets the data from the given source URI
func (*UsesResolver) UsesSteps ¶ added in v0.0.918
func (r *UsesResolver) UsesSteps(sourceURI string, taskName string, step tektonv1beta1.Step) ([]tektonv1beta1.Step, error)
UsesSteps lets resolve the sourceURI to a PipelineRun and find the step or steps for the given task name and/or step name then lets apply any overrides from the step