inrepo

package
v1.12.8 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: Apache-2.0 Imports: 24 Imported by: 2

Documentation

Index

Constants

View Source
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"
)
View Source
const DELIMIER = "#"

Variables

View Source
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 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(fileBrowsers *filebrowser.FileBrowsers, fc filebrowser.FetchCache, cache *ResolverCache, 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 LoadTektonResourceAsPipelineRun added in v0.0.858

func LoadTektonResourceAsPipelineRun(data []byte, ownerName string, repoName string, sha string) (*tektonv1beta1.PipelineRun, error)

func LoadTriggerConfig

func LoadTriggerConfig(fileBrowsers *filebrowser.FileBrowsers, fc filebrowser.FetchCache, cache *ResolverCache, 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, fileBrowsers *filebrowser.FileBrowsers, fc filebrowser.FetchCache, cache *ResolverCache, 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

func OverrideEnv(from []v1.EnvVar, overrides []v1.EnvVar, modify bool) []v1.EnvVar

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, modify bool) []v1.EnvFromSource

OverrideEnvFrom override either replaces or adds the given env froms

func OverrideResourceList added in v1.0.4

func OverrideResourceList(requests v1.ResourceList, override v1.ResourceList, modify bool) v1.ResourceList

OverrideResourceList overrides resource list properties

func OverrideResources added in v1.0.4

func OverrideResources(resources v1.ResourceRequirements, override v1.ResourceRequirements, modify bool) v1.ResourceRequirements

OverrideResources overrides any resources

func OverrideStep added in v0.0.918

func OverrideStep(step *tektonv1beta1.Step, override *tektonv1beta1.Step)

OverrideStep overrides the step with the given overrides

func OverrideStepWithStep added in v1.12.0

func OverrideStepWithStep(c *tektonv1beta1.Step, override *tektonv1beta1.Step, modify bool)

OverrideTemplateWithStep overrides the container properties

func OverrideTaskSpec added in v1.0.4

func OverrideTaskSpec(ts *tektonv1beta1.TaskSpec, override *tektonv1beta1.TaskSpec)

OverrideTaskSpec lets reuse any TaskSpec resources from the used task

func OverrideTemplateWithTemplate added in v1.12.0

func OverrideTemplateWithTemplate(c *tektonv1beta1.StepTemplate, override *tektonv1beta1.StepTemplate, modify bool)

OverrideTemplateWithStep overrides the container properties

func OverrideVolumeMounts added in v0.0.918

func OverrideVolumeMounts(from []v1.VolumeMount, overrides []v1.VolumeMount, modify bool) []v1.VolumeMount

OverrideVolumeMounts override either replaces or adds the given volume mounts

func OverrideVolumes added in v1.0.4

func OverrideVolumes(from []v1.Volume, overrides []v1.Volume, modify bool) []v1.Volume

OverrideVolumes override either replaces or adds the given volumes

func ToDefaultParams added in v1.0.7

func ToDefaultParams(params []v1beta1.ParamSpec) []v1beta1.Param

ToDefaultParams converts the param specs to default params

func ToParams added in v0.0.858

func ToParams(params []tektonv1beta1.ParamSpec) []tektonv1beta1.Param

ToParams converts the param specs to params

func ToPipelineWorkspaceDeclaration added in v0.0.858

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

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 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 UseParametersAndResults added in v1.0.6

func UseParametersAndResults(ctx context.Context, loc *UseLocation, uses *v1beta1.TaskSpec) error

UseParametersAndResults adds the parameters from the used Task to the PipelineSpec if specified and the PipelineTask

func VersionStreamEnvVar added in v0.0.918

func VersionStreamEnvVar(owner string, repo string) string

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 creates 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

type GitURI struct {
	Server     string
	Owner      string
	Repository string
	Path       string
	SHA        string
}

GitURI the output of parsing Git URIs

func ParseGitURI added in v0.0.918

func ParseGitURI(text string) (*GitURI, error)

ParseGitURI parses git source URIs or returns nil if its not a valid URI

handles strings of the form "owner/repository(/path)@sha"

func (*GitURI) String added in v0.0.918

func (u *GitURI) String() string

String returns the string representation of the git URI

type ResolverCache added in v0.0.920

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

ResolverCache a cache of data and pipelines to minimise the git cloning with in repo configurations

func NewResolverCache added in v0.0.920

func NewResolverCache() *ResolverCache

NewResolverCache creates a new resolver cache

func (*ResolverCache) GetData added in v0.0.920

func (c *ResolverCache) GetData(sourceURI, ref string) []byte

GetData gets data from the cache if available or returns nil

func (*ResolverCache) GetPipelineRun added in v0.0.920

func (c *ResolverCache) GetPipelineRun(sourceURI, ref string) *tektonv1beta1.PipelineRun

GetPipelineRun gets the PipelineRun from the cache if available or returns nil

func (*ResolverCache) SetData added in v0.0.920

func (c *ResolverCache) SetData(sourceURI, ref string, value []byte)

SetData updates the cache

func (*ResolverCache) SetPipelineRun added in v0.0.920

func (c *ResolverCache) SetPipelineRun(sourceURI string, ref string, value *tektonv1beta1.PipelineRun)

SetPipelineRun updates the cache

type UseLocation added in v1.0.6

type UseLocation struct {
	PipelineRunSpec *v1beta1.PipelineRunSpec
	PipelineSpec    *v1beta1.PipelineSpec
	PipelineTask    *v1beta1.PipelineTask
	TaskName        string
	TaskRunSpec     *v1beta1.TaskRunSpec
	TaskSpec        *v1beta1.TaskSpec
}

UseLocation defines the location where we are using one or more steps where we may need to modify the parameters, results and workspaces

Jump to

Keyboard shortcuts

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