Documentation
¶
Index ¶
- func GetCommmitAnnotation() string
- func GetHttpsRepoUrlAnnotation() string
- func GetPrIdAnnotation() string
- func GetRefAnnotation() string
- func GetTechnicalJobAnnotation() string
- func IsJobHavingRequiredLabel(labels map[string]string) bool
- func PipelineInfoWithLogsCollector(collector func() string) func(pipelineInfo *PipelineInfo)
- func PipelineInfoWithUrl(url string) func(pipelineInfo *PipelineInfo)
- type ConfigurationData
- type JobContext
- type PipelineInfo
- func (pi PipelineInfo) GetAnnotations() labels.Labels
- func (pi PipelineInfo) GetDashboardUrl() string
- func (pi PipelineInfo) GetFullName() string
- func (pi PipelineInfo) GetId() string
- func (pi PipelineInfo) GetInstanceName() string
- func (pi PipelineInfo) GetLabels() labels.Labels
- func (pi PipelineInfo) GetLogs() string
- func (pi PipelineInfo) GetName() string
- func (pi PipelineInfo) GetNamespace() string
- func (pi PipelineInfo) GetSCMContext() JobContext
- func (pi PipelineInfo) GetStages() []PipelineStage
- func (pi PipelineInfo) GetStatus() Status
- func (pi PipelineInfo) IsJustCreated() bool
- func (pi PipelineInfo) SetRetrievalCount(num int)
- func (pi PipelineInfo) ToHash() string
- type PipelineStage
- type Pluggable
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCommmitAnnotation ¶
func GetCommmitAnnotation() string
GetCommmitAnnotation returns by default "pipelinesfeedback.keskad.pl/commit". Parametrized with 'ANNOTATION_FEEDBACK_BASE' env variable
func GetHttpsRepoUrlAnnotation ¶
func GetHttpsRepoUrlAnnotation() string
GetHttpsRepoUrlAnnotation returns by default "pipelinesfeedback.keskad.pl/https-repo-url". Parametrized with 'ANNOTATION_FEEDBACK_BASE' env variable
func GetPrIdAnnotation ¶
func GetPrIdAnnotation() string
GetPrIdAnnotation returns by default "pipelinesfeedback.keskad.pl/pr-id". Parametrized with 'ANNOTATION_FEEDBACK_BASE' env variable
func GetRefAnnotation ¶
func GetRefAnnotation() string
GetRefAnnotation returns by default "pipelinesfeedback.keskad.pl/ref". Parametrized with 'ANNOTATION_FEEDBACK_BASE' env variable
func GetTechnicalJobAnnotation ¶
func GetTechnicalJobAnnotation() string
GetTechnicalJobAnnotation returns by default "pipelinesfeedback.keskad.pl/technical-job". Parametrized with 'ANNOTATION_FEEDBACK_BASE' env variable
func IsJobHavingRequiredLabel ¶
IsJobHavingRequiredLabel decides if a controller should take the resource
func PipelineInfoWithLogsCollector ¶
func PipelineInfoWithLogsCollector(collector func() string) func(pipelineInfo *PipelineInfo)
PipelineInfoWithLogsCollector should return whole Pipeline logs on demand. Implement is as lazy-fetch function
func PipelineInfoWithUrl ¶
func PipelineInfoWithUrl(url string) func(pipelineInfo *PipelineInfo)
PipelineInfoWithUrl is setting optionally a URL pointing to a Pipeline visualization
Types ¶
type ConfigurationData ¶
type JobContext ¶
type JobContext struct { // Commit represents long commit hash Commit string // Reference represents a full GIT reference e.g. refs/heads/v1.6.1 or refs/heads/release-1.3.1.2 Reference string // RepoHttpsUrl describes a full URL to the repository in HTTPS format RepoHttpsUrl string // PrId is a pull/merge request id PrId string OrganizationName string RepositoryName string // When a job does not have a SCM context, but has a technical-job annotation TechnicalJob string }
func NewSCMContext ¶
func NewSCMContext(repoHttpsUrl string) (JobContext, error)
func (JobContext) GetNameWithOrg ¶
func (c JobContext) GetNameWithOrg() string
func (JobContext) IsTechnicalJob ¶
func (c JobContext) IsTechnicalJob() bool
func (JobContext) IsValid ¶
func (c JobContext) IsValid() bool
type PipelineInfo ¶
type PipelineInfo struct {
// contains filtered or unexported fields
}
PipelineInfo is a point-in-time Pipeline status including the SCM information
func NewPipelineInfo ¶
func NewPipelineInfo(scm JobContext, namespace string, name string, instanceName string, dateStarted time.Time, stages []PipelineStage, labels labels.Labels, annotations labels.Labels, globalCfg ConfigurationData, options ...func(info *PipelineInfo)) *PipelineInfo
func (PipelineInfo) GetAnnotations ¶
func (pi PipelineInfo) GetAnnotations() labels.Labels
GetAnnotations returns Kubernetes object .metadata.annotations
func (PipelineInfo) GetDashboardUrl ¶
func (pi PipelineInfo) GetDashboardUrl() string
GetDashboardUrl returns a URL to some dashboard, where the pipeline could be looked up
func (PipelineInfo) GetFullName ¶
func (pi PipelineInfo) GetFullName() string
GetFullName returns a namespace, object name and its instance name (often uid or generated name)
func (PipelineInfo) GetId ¶
func (pi PipelineInfo) GetId() string
GetId is returning execution ID, unique for a single Pipeline execution
func (PipelineInfo) GetInstanceName ¶
func (pi PipelineInfo) GetInstanceName() string
GetInstanceName is returning execution name, a short name
func (PipelineInfo) GetLabels ¶
func (pi PipelineInfo) GetLabels() labels.Labels
GetLabels returns Kubernetes object .metadata.labels
func (PipelineInfo) GetLogs ¶
func (pi PipelineInfo) GetLogs() string
GetLogs is returning truncated logs. It is a lazy-loaded method, fetches logs on demand. After first fetch logs are kept in the memory
func (PipelineInfo) GetName ¶
func (pi PipelineInfo) GetName() string
GetName returns a full object name, including namespace
func (PipelineInfo) GetNamespace ¶
func (pi PipelineInfo) GetNamespace() string
func (PipelineInfo) GetSCMContext ¶
func (pi PipelineInfo) GetSCMContext() JobContext
func (PipelineInfo) GetStages ¶
func (pi PipelineInfo) GetStages() []PipelineStage
GetStages returns a stage list with statuses for each
func (PipelineInfo) GetStatus ¶
func (pi PipelineInfo) GetStatus() Status
GetStatus is calculating the pipeline status basing on the results of all children stages
func (PipelineInfo) IsJustCreated ¶
func (pi PipelineInfo) IsJustCreated() bool
IsJustCreated tells us if the resource was retrieved from the cluster first time
func (PipelineInfo) SetRetrievalCount ¶
func (pi PipelineInfo) SetRetrievalCount(num int)
SetRetrievalCount (for internal use only)
func (PipelineInfo) ToHash ¶
func (pi PipelineInfo) ToHash() string
type PipelineStage ¶
PipelineStage represents a status of a particular Pipeline stage (naming: in Jenkins "Stage", in Tekton "Task")
type Status ¶
type Status string