Documentation ¶
Index ¶
- Constants
- func GetBranchName() string
- func GetBranchNameFromLabels(m map[string]string) string
- func GetBuildLogsForPod(podInterface v1.PodInterface, pod *corev1.Pod) ([]byte, error)
- func GetBuildNumber() string
- func GetBuildNumberFromLabels(m map[string]string) string
- func GetBuildNumberFromLabelsWithKeys(m map[string]string, keys ...string) string
- func GetBuildPacks(jxClient versioned.Interface, ns string) (map[string]*v1.BuildPack, []string, error)
- func GetBuildPods(kubeClient kubernetes.Interface, ns string) ([]*corev1.Pod, error)
- func GetValueFromLabels(m map[string]string, keys ...string) string
- func LoadDownwardAPILabels(text string) map[string]string
- func SortBuildPacks(buildPacks []v1.BuildPack)
- func SortBuildPodInfos(buildPodInfos []*BuildPodInfo)
- type BaseBuildInfo
- type BuildPackOrder
- type BuildPodInfo
- type BuildPodInfoFilter
- type BuildPodInfoOrder
- type JenkinsConverter
Constants ¶
const ( // ClassicWorkloadBuildPackURL the git URL for classic workload build packs ClassicWorkloadBuildPackURL = "https://github.com/jenkins-x-buildpacks/jenkins-x-classic.git" // ClassicWorkloadBuildPackRef the git reference/version for the classic workloads build packs ClassicWorkloadBuildPackRef = "master" // KubernetesWorkloadBuildPackURL the git URL for kubernetes workloads build packs KubernetesWorkloadBuildPackURL = "https://github.com/jenkins-x-buildpacks/jenkins-x-kubernetes.git" // KubernetesWorkloadBuildPackRef the git reference/version for the kubernetes workloads build packs KubernetesWorkloadBuildPackRef = "master" )
const ( // LabelBuildName the label used on a pod for the build name LabelBuildName = "build.knative.dev/buildName" LabelOldBuildName = "build-name" // LabelPipelineRunName the label used on a pod created via Build Pipeline for the build name. LabelPipelineRunName = "tekton.dev/pipelineRun" // LabelTaskName the label used on a pod created via Tekton for the task name LabelTaskName = "tekton.dev/task" // LabelTaskRunName the label used on a pod created via Tekton for the taskrun name LabelTaskRunName = "tekton.dev/taskRun" )
Variables ¶
This section is empty.
Functions ¶
func GetBranchName ¶ added in v1.3.938
func GetBranchName() string
GetBranchName returns the branch name using environment variables and/or pod Downward API
func GetBranchNameFromLabels ¶ added in v1.3.943
GetBranchNameFromLabels returns the branch name from the given pod labels
func GetBuildLogsForPod ¶
GetBuildLogsForPod returns the pod log for a Knative Build style build pod which is based on init containers
func GetBuildNumber ¶ added in v1.3.819
func GetBuildNumber() string
GetBuildNumber returns the build number using environment variables and/or pod Downward API files
func GetBuildNumberFromLabels ¶ added in v1.3.820
GetBuildNumberFromLabels returns the
func GetBuildNumberFromLabelsWithKeys ¶ added in v1.3.943
GetBuildNumberFromLabelsWithKeys returns the build number from the given Pod labels
func GetBuildPacks ¶
func GetBuildPacks(jxClient versioned.Interface, ns string) (map[string]*v1.BuildPack, []string, error)
GetBuildPacks returns a map of the BuildPacks along with the correctly ordered names
func GetBuildPods ¶
GetBuildPods returns all the build pods in the given namespace
func GetValueFromLabels ¶ added in v1.3.938
GetValueFromLabels returns the first label with the given key
func LoadDownwardAPILabels ¶ added in v1.3.819
LoadDownwardAPILabels parses the /etc/podinfo/labels text into a map of label values
func SortBuildPacks ¶
SortBuildPacks sorts the build packs in order
func SortBuildPodInfos ¶
func SortBuildPodInfos(buildPodInfos []*BuildPodInfo)
Types ¶
type BaseBuildInfo ¶ added in v1.3.921
type BaseBuildInfo interface {
GetBuild() string
}
BaseBuildInfo is an interface that is implemented by both BuildPodInfo here and tekton.PipelineRunInfo
type BuildPackOrder ¶
BuildPackOrder used to sort the build packs in label order
func (BuildPackOrder) Len ¶
func (a BuildPackOrder) Len() int
func (BuildPackOrder) Less ¶
func (a BuildPackOrder) Less(i, j int) bool
func (BuildPackOrder) Swap ¶
func (a BuildPackOrder) Swap(i, j int)
type BuildPodInfo ¶
type BuildPodInfo struct { PodName string Name string Organisation string Repository string Branch string Build string Context string BuildNumber int Pipeline string LastCommitSHA string LastCommitMessage string LastCommitURL string GitURL string FirstStepImage string CreatedTime time.Time GitInfo *gits.GitRepository Pod *corev1.Pod }
func CreateBuildPodInfo ¶
func CreateBuildPodInfo(pod *corev1.Pod) *BuildPodInfo
CreateBuildPodInfo creates a BuildPodInfo from a Pod
func (BuildPodInfo) GetBuild ¶ added in v1.3.921
func (b BuildPodInfo) GetBuild() string
GetBuild gets the build identifier
func (*BuildPodInfo) MatchesPipeline ¶
func (b *BuildPodInfo) MatchesPipeline(activity *v1.PipelineActivity) bool
MatchesPipeline returns true if this build info matches the given pipeline
func (*BuildPodInfo) Status ¶
func (b *BuildPodInfo) Status() string
Status returns the build status
type BuildPodInfoFilter ¶
type BuildPodInfoFilter struct { Owner string Repository string Branch string Build string Filter string Pod string Pending bool }
func (*BuildPodInfoFilter) BuildMatches ¶
func (o *BuildPodInfoFilter) BuildMatches(info *BuildPodInfo) bool
BuildMatches returns true if the build info matches the filter
func (*BuildPodInfoFilter) BuildNumber ¶
func (o *BuildPodInfoFilter) BuildNumber() int
BuildNumber returns the integer build number filter if specified
type BuildPodInfoOrder ¶
type BuildPodInfoOrder []*BuildPodInfo
func (BuildPodInfoOrder) Len ¶
func (a BuildPodInfoOrder) Len() int
func (BuildPodInfoOrder) Less ¶
func (a BuildPodInfoOrder) Less(i, j int) bool
func (BuildPodInfoOrder) Swap ¶
func (a BuildPodInfoOrder) Swap(i, j int)
type JenkinsConverter ¶
type JenkinsConverter struct { Indentation string KubernetesPluginMode bool ProjectConfig *config.ProjectConfig // contains filtered or unexported fields }
func NewJenkinsConverter ¶
func NewJenkinsConverter(projectConfig *config.ProjectConfig) *JenkinsConverter
NewJenkinsConverter creates a new JenkinsConverter instance
func (*JenkinsConverter) String ¶
func (j *JenkinsConverter) String() string
func (*JenkinsConverter) ToJenkinsfile ¶
func (j *JenkinsConverter) ToJenkinsfile() (string, error)