Documentation ¶
Index ¶
- func CompletePromote(p *v1.PromoteActivityStep) error
- func CompletePromotionPullRequest(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, ...) error
- func CompletePromotionUpdate(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, ...) error
- func FailedPromote(p *v1.PromoteActivityStep) error
- func FailedPromotionPullRequest(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, ...) error
- func FailedPromotionUpdate(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, ...) error
- func GenerateBuildNumber(activities typev1.PipelineActivityInterface, pipelines []*v1.PipelineActivity, ...) (string, *v1.PipelineActivity, error)
- func GetOrCreateStage(a *v1.PipelineActivity, stageName string) (*v1.PipelineActivityStep, *v1.StageActivityStep, bool)
- func GetStepValueFromStage(stage *v1.StageActivityStep, stepName string) (v1.CoreActivityStep, bool)
- func ListSelectedPipelineActivities(activitiesClient typev1.PipelineActivityInterface, labelSelector fmt.Stringer, ...) (*v1.PipelineActivityList, error)
- func SortActivities(activities []v1.PipelineActivity)
- func StartPromote(p *v1.PromoteActivityStep) error
- func StartPromotionPullRequest(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, ...) error
- func StartPromotionUpdate(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, ...) error
- func ToProviderName(gitURL string) string
- func UpdateStatus(activity *v1.PipelineActivity, containersTerminated bool, ...)
- func UpdateStepsStatus(status v1.ActivityStatusType, steps []v1.CoreActivityStep) v1.ActivityStatusType
- type ByTimestamp
- type PipelineActivityKey
- func (k *PipelineActivityKey) GetOrCreate(jxClient versioned.Interface, ns string) (*v1.PipelineActivity, bool, error)
- func (k *PipelineActivityKey) GitOwner() string
- func (k *PipelineActivityKey) GitRepository() string
- func (k *PipelineActivityKey) GitURL() string
- func (k *PipelineActivityKey) IsValid() bool
- type PipelineDetails
- type PipelineID
- type PromotePullRequestFn
- type PromoteStepActivityKey
- func (k *PromoteStepActivityKey) GetOrCreatePreview(jxClient versioned.Interface, ns string) (*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PreviewActivityStep, bool, ...)
- func (k *PromoteStepActivityKey) GetOrCreatePromote(jxClient versioned.Interface, ns string) (*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, bool, ...)
- func (k *PromoteStepActivityKey) GetOrCreatePromotePullRequest(jxClient versioned.Interface, ns string) (*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, ...)
- func (k *PromoteStepActivityKey) GetOrCreatePromoteUpdate(jxClient versioned.Interface, ns string) (*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, ...)
- func (k *PromoteStepActivityKey) OnPromotePullRequest(kubeClient kubernetes.Interface, jxClient versioned.Interface, ns string, ...) error
- func (k *PromoteStepActivityKey) OnPromoteUpdate(kubeClient kubernetes.Interface, jxClient versioned.Interface, ns string, ...) error
- type PromoteUpdateFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompletePromote ¶
func CompletePromote(p *v1.PromoteActivityStep) error
func CompletePromotionPullRequest ¶
func CompletePromotionPullRequest(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, p *v1.PromotePullRequestStep) error
func CompletePromotionUpdate ¶
func CompletePromotionUpdate(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, p *v1.PromoteUpdateStep) error
func FailedPromote ¶
func FailedPromote(p *v1.PromoteActivityStep) error
func FailedPromotionPullRequest ¶
func FailedPromotionPullRequest(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, p *v1.PromotePullRequestStep) error
func FailedPromotionUpdate ¶
func FailedPromotionUpdate(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, p *v1.PromoteUpdateStep) error
func GenerateBuildNumber ¶
func GenerateBuildNumber(activities typev1.PipelineActivityInterface, pipelines []*v1.PipelineActivity, pn PipelineID) (string, *v1.PipelineActivity, error)
GenerateBuildNumber generates a new build number for the given pipeline
func GetOrCreateStage ¶
func GetOrCreateStage(a *v1.PipelineActivity, stageName string) (*v1.PipelineActivityStep, *v1.StageActivityStep, bool)
GetOrCreateStage gets or creates the stage for the given name
func GetStepValueFromStage ¶
func GetStepValueFromStage(stage *v1.StageActivityStep, stepName string) (v1.CoreActivityStep, bool)
GetStepValueFromStage gets the value for the step for the given name in the given stage, if it already exists. If it doesn't exist, it will create a new step for that name instead.
func ListSelectedPipelineActivities ¶
func ListSelectedPipelineActivities(activitiesClient typev1.PipelineActivityInterface, labelSelector fmt.Stringer, fieldSelector fields.Selector) (*v1.PipelineActivityList, error)
ListSelectedPipelineActivities retrieves the PipelineActivities instances matching the specified label and field selectors. Selectors can be empty or nil.
func SortActivities ¶
func SortActivities(activities []v1.PipelineActivity)
SortActivities sorts a list of PipelineActivities
func StartPromote ¶
func StartPromote(p *v1.PromoteActivityStep) error
func StartPromotionPullRequest ¶
func StartPromotionPullRequest(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, p *v1.PromotePullRequestStep) error
func StartPromotionUpdate ¶
func StartPromotionUpdate(a *v1.PipelineActivity, s *v1.PipelineActivityStep, ps *v1.PromoteActivityStep, p *v1.PromoteUpdateStep) error
func ToProviderName ¶
ToProviderName takes the git URL and converts it to a provider name which can be used as a label selector
func UpdateStatus ¶ added in v1.0.81
func UpdateStatus(activity *v1.PipelineActivity, containersTerminated bool, onCompleteCallback func(activity *v1.PipelineActivity))
UpdateStatus updates the pipeline activity status if any of the steps have failed or they have all completed
func UpdateStepsStatus ¶ added in v1.0.83
func UpdateStepsStatus(status v1.ActivityStatusType, steps []v1.CoreActivityStep) v1.ActivityStatusType
UpdateStepsStatus updates the status for the given status and steps
Types ¶
type ByTimestamp ¶
type ByTimestamp []v1.PipelineActivity
ByTimestamp is used to fileter a list of PipelineActivities by their given timestamp
func (ByTimestamp) Len ¶
func (a ByTimestamp) Len() int
func (ByTimestamp) Less ¶
func (a ByTimestamp) Less(i, j int) bool
func (ByTimestamp) Swap ¶
func (a ByTimestamp) Swap(i, j int)
type PipelineActivityKey ¶
type PipelineActivityKey struct { Name string Pipeline string Build string Version string BuildURL string BuildLogsURL string ReleaseNotesURL string LastCommitSHA string LastCommitMessage string LastCommitURL string GitInfo *giturl.GitRepository PullRefs map[string]string Context string Annotations map[string]string Labels map[string]string }
func (*PipelineActivityKey) GetOrCreate ¶
func (k *PipelineActivityKey) GetOrCreate(jxClient versioned.Interface, ns string) (*v1.PipelineActivity, bool, error)
GetOrCreate gets or creates the pipeline activity
func (*PipelineActivityKey) GitOwner ¶
func (k *PipelineActivityKey) GitOwner() string
GitOwner returns the git owner (person / organisation) or blank string if it cannot be found
func (*PipelineActivityKey) GitRepository ¶
func (k *PipelineActivityKey) GitRepository() string
GitRepository returns the git repository name or blank string if it cannot be found
func (*PipelineActivityKey) GitURL ¶
func (k *PipelineActivityKey) GitURL() string
GitURL returns the git URL or blank string if it cannot be found
func (*PipelineActivityKey) IsValid ¶
func (k *PipelineActivityKey) IsValid() bool
type PipelineDetails ¶
type PipelineDetails struct { GitOwner string GitRepository string BranchName string Pipeline string Build string Context string }
func CreatePipelineDetails ¶
func CreatePipelineDetails(activity *v1.PipelineActivity) *PipelineDetails
CreatePipelineDetails creates a PipelineDetails object populated from the activity
type PipelineID ¶
PipelineID is an identifier for a Pipeline. A pipeline is typically identified by its owner, repository, and branch with the ID field taking the form `<owner>/>repository>/<branch>`
func NewPipelineID ¶
func NewPipelineID(owner string, repository string, branch string) PipelineID
NewPipelineID creates a new PipelineID for a given owner, repository, and branch.
func NewPipelineIDFromString ¶
func NewPipelineIDFromString(id string) PipelineID
NewPipelineIDFromString creates a new PipelineID, given a pre-built string identifier. The string identifier is expected to follow the format `<owner>/>repository>/<branch>`, though this isn't actually validated/mandated here.
func (*PipelineID) GetActivityName ¶
func (p *PipelineID) GetActivityName(activity string) string
GetActivityName Builds a Kubernetes-friendly (i.e. a-z,-,. only) name for a specific activity, within a pipeline.
type PromotePullRequestFn ¶
type PromotePullRequestFn func(*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, *v1.PromotePullRequestStep) error
type PromoteStepActivityKey ¶
type PromoteStepActivityKey struct { PipelineActivityKey Environment string ApplicationURL string }
func (*PromoteStepActivityKey) GetOrCreatePreview ¶
func (k *PromoteStepActivityKey) GetOrCreatePreview(jxClient versioned.Interface, ns string) (*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PreviewActivityStep, bool, error)
GetOrCreatePreview gets or creates the Preview step for the key
func (*PromoteStepActivityKey) GetOrCreatePromote ¶
func (k *PromoteStepActivityKey) GetOrCreatePromote(jxClient versioned.Interface, ns string) (*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, bool, error)
GetOrCreatePromote gets or creates the Promote step for the key
func (*PromoteStepActivityKey) GetOrCreatePromotePullRequest ¶
func (k *PromoteStepActivityKey) GetOrCreatePromotePullRequest(jxClient versioned.Interface, ns string) (*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, *v1.PromotePullRequestStep, bool, error)
GetOrCreatePromotePullRequest gets or creates the PromotePullRequest for the key
func (*PromoteStepActivityKey) GetOrCreatePromoteUpdate ¶
func (k *PromoteStepActivityKey) GetOrCreatePromoteUpdate(jxClient versioned.Interface, ns string) (*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, *v1.PromoteUpdateStep, bool, error)
GetOrCreatePromoteUpdate gets or creates the Promote for the key
func (*PromoteStepActivityKey) OnPromotePullRequest ¶
func (k *PromoteStepActivityKey) OnPromotePullRequest(kubeClient kubernetes.Interface, jxClient versioned.Interface, ns string, fn PromotePullRequestFn) error
OnPromotePullRequest updates activities on a Promote PR
func (*PromoteStepActivityKey) OnPromoteUpdate ¶
func (k *PromoteStepActivityKey) OnPromoteUpdate(kubeClient kubernetes.Interface, jxClient versioned.Interface, ns string, fn PromoteUpdateFn) error
OnPromoteUpdate updates activities on a Promote Update
type PromoteUpdateFn ¶
type PromoteUpdateFn func(*v1.PipelineActivity, *v1.PipelineActivityStep, *v1.PromoteActivityStep, *v1.PromoteUpdateStep) error