Documentation ¶
Index ¶
- Constants
- func CreateOrUpdatePipeline(tektonClient tektonclient.Interface, ns string, created *v1alpha1.Pipeline, ...) (*v1alpha1.Pipeline, error)
- func CreateOrUpdateSourceResource(tektonClient tektonclient.Interface, ns string, ...) (*v1alpha1.PipelineResource, error)
- func CreateOrUpdateTask(tektonClient tektonclient.Interface, ns string, created *v1alpha1.Task) (*v1alpha1.Task, error)
- func CreatePipelineRun(tektonClient tektonclient.Interface, ns string, pipeline *v1alpha1.Pipeline, ...) (*v1alpha1.PipelineRun, error)
- func GetLastBuildNumber(pipeline *v1alpha1.Pipeline) int
- func PipelineResourceName(gitInfo *gits.GitRepository, branch string, context string) string
- func SortPipelineRunInfos(pris []*PipelineRunInfo)
- func UpdateLastPipelineBuildNumber(tektonClient tektonclient.Interface, ns string, pipeline *v1alpha1.Pipeline, ...) error
- type PipelineRunInfo
- func (pri *PipelineRunInfo) FindFirstStagePod() *corev1.Pod
- func (pri PipelineRunInfo) GetBuild() string
- func (pri *PipelineRunInfo) GetOrderedTaskStages() []*StageInfo
- func (pri *PipelineRunInfo) MatchesPipeline(activity *v1.PipelineActivity) bool
- func (pri *PipelineRunInfo) SetPodsForPipelineRun(kubeClient kubernetes.Interface, tektonClient tektonclient.Interface, ...) error
- func (pri *PipelineRunInfo) Status() string
- type PipelineRunInfoFilter
- type PipelineRunInfoOrder
- type StageInfo
Constants ¶
const (
// LastBuildNumberAnnotation used to annotate the Pipeline with the latest build number
LastBuildNumberAnnotation = "jenkins.io/last-build-number"
)
Variables ¶
This section is empty.
Functions ¶
func CreateOrUpdatePipeline ¶
func CreateOrUpdatePipeline(tektonClient tektonclient.Interface, ns string, created *v1alpha1.Pipeline, labels map[string]string) (*v1alpha1.Pipeline, error)
CreateOrUpdatePipeline lazily creates a Tekton Pipeline for the given git repository, branch and context
func CreateOrUpdateSourceResource ¶
func CreateOrUpdateSourceResource(tektonClient tektonclient.Interface, ns string, created *v1alpha1.PipelineResource) (*v1alpha1.PipelineResource, error)
CreateOrUpdateSourceResource lazily creates a Tekton Pipeline PipelineResource for the given git repository
func CreateOrUpdateTask ¶
func CreateOrUpdateTask(tektonClient tektonclient.Interface, ns string, created *v1alpha1.Task) (*v1alpha1.Task, error)
CreateOrUpdateTask lazily creates a Tekton Pipeline Task
func CreatePipelineRun ¶
func CreatePipelineRun(tektonClient tektonclient.Interface, ns string, pipeline *v1alpha1.Pipeline, run *v1alpha1.PipelineRun, previewVersionPrefix string, duration time.Duration) (*v1alpha1.PipelineRun, error)
CreatePipelineRun lazily creates a Tekton Pipeline Task
func GetLastBuildNumber ¶
GetLastBuildNumber returns the last build number on the Pipeline
func PipelineResourceName ¶
func PipelineResourceName(gitInfo *gits.GitRepository, branch string, context string) string
PipelineResourceName returns the pipeline resource name for the given git repository, branch and context
func SortPipelineRunInfos ¶
func SortPipelineRunInfos(pris []*PipelineRunInfo)
SortPipelineRunInfos sorts a slice of PipelineRunInfos by their org, repo, branch, and build number
func UpdateLastPipelineBuildNumber ¶
func UpdateLastPipelineBuildNumber(tektonClient tektonclient.Interface, ns string, pipeline *v1alpha1.Pipeline, buildNumber int, params map[string]string, duration time.Duration) error
UpdateLastPipelineBuildNumber keeps trying to update the last build number annotation on the Pipeline until it succeeds or another thread/process beats us to it
Types ¶
type PipelineRunInfo ¶
type PipelineRunInfo struct { Name string Organisation string Repository string Branch string Build string BuildNumber int Pipeline string PipelineRun string LastCommitSHA string LastCommitMessage string LastCommitURL string GitURL string GitInfo *gits.GitRepository Stages []*StageInfo }
PipelineRunInfo provides information on a PipelineRun and its stages for use in getting logs and populating activity
func CreatePipelineRunInfo ¶
func CreatePipelineRunInfo(kubeClient kubernetes.Interface, tektonClient tektonclient.Interface, jxClient versioned.Interface, ns, prName string) (*PipelineRunInfo, error)
CreatePipelineRunInfo looks up the PipelineRun for a given name and creates the PipelineRunInfo for it
func (*PipelineRunInfo) FindFirstStagePod ¶
func (pri *PipelineRunInfo) FindFirstStagePod() *corev1.Pod
FindFirstStagePod finds the first stage in this pipeline run to have a pod, and then returns its pod
func (PipelineRunInfo) GetBuild ¶
func (pri PipelineRunInfo) GetBuild() string
GetBuild gets the build identifier
func (*PipelineRunInfo) GetOrderedTaskStages ¶
func (pri *PipelineRunInfo) GetOrderedTaskStages() []*StageInfo
GetOrderedTaskStages gets all the stages in this pipeline which actually contain a Task, in rough execution order TODO: Handle parallelism better, where execution is not a straight line.
func (*PipelineRunInfo) MatchesPipeline ¶
func (pri *PipelineRunInfo) MatchesPipeline(activity *v1.PipelineActivity) bool
MatchesPipeline returns true if this build info matches the given pipeline
func (*PipelineRunInfo) SetPodsForPipelineRun ¶
func (pri *PipelineRunInfo) SetPodsForPipelineRun(kubeClient kubernetes.Interface, tektonClient tektonclient.Interface, jxClient versioned.Interface, ns string) error
SetPodsForPipelineRun populates the pods for all stages within its PipelineRunInfo
func (*PipelineRunInfo) Status ¶
func (pri *PipelineRunInfo) Status() string
Status returns the build status
type PipelineRunInfoFilter ¶
type PipelineRunInfoFilter struct { Owner string Repository string Branch string Build string Filter string Pending bool }
PipelineRunInfoFilter allows specifying criteria on which to filter a list of PipelineRunInfos
func (*PipelineRunInfoFilter) BuildNumber ¶
func (o *PipelineRunInfoFilter) BuildNumber() int
BuildNumber returns the integer build number filter if specified
func (*PipelineRunInfoFilter) PipelineRunMatches ¶
func (o *PipelineRunInfoFilter) PipelineRunMatches(info *PipelineRunInfo) bool
PipelineRunMatches returns true if the pipeline run info matches the filter
type PipelineRunInfoOrder ¶
type PipelineRunInfoOrder []*PipelineRunInfo
PipelineRunInfoOrder allows sorting of a slice of PipelineRunInfos
func (PipelineRunInfoOrder) Len ¶
func (a PipelineRunInfoOrder) Len() int
func (PipelineRunInfoOrder) Less ¶
func (a PipelineRunInfoOrder) Less(i, j int) bool
func (PipelineRunInfoOrder) Swap ¶
func (a PipelineRunInfoOrder) Swap(i, j int)
type StageInfo ¶
type StageInfo struct { // TODO: For now, we're not including git info - we're going to assume we have the same git info for the whole // pipeline. Name string // These fields will populated for all non-parent stages PodName string Task string TaskRun string FirstStepImage string CreatedTime time.Time Pod *corev1.Pod // These fields will only be populated for appropriate parent stages Parallel []*StageInfo Stages []*StageInfo // This field will be non-empty if this is a nested stage, containing a list of the names of all its parent stages with the top-level parent first Parents []string }
StageInfo provides information on a particular stage, including its pod info or info on its nested stages
func (*StageInfo) GetFullChildStageNames ¶
GetFullChildStageNames gets the fully qualified (i.e., with parents appended) names of each stage underneath this one.
func (*StageInfo) GetStageNameIncludingParents ¶
GetStageNameIncludingParents constructs a full stage name including its parents, if they exist.
func (*StageInfo) SetPodsForStageInfo ¶
func (si *StageInfo) SetPodsForStageInfo(kubeClient kubernetes.Interface, tektonClient tektonclient.Interface, ns, prName string) error
SetPodsForStageInfo populates the pods for a particular stage and/or its children