Documentation ¶
Index ¶
- Constants
- func GetBuildLogsForPod(podInterface v1.PodInterface, pod *corev1.Pod) ([]byte, error)
- func GetBuildNumber() string
- func GetBuildNumberFromLabels(m map[string]string) string
- func GetBuildNumberFromLabelsFileData(text 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 LoadDownwardAPILabels(text string) map[string]string
- func SortBuildPacks(buildPacks []v1.BuildPack)
- func SortBuildPodInfos(buildPodInfos []*BuildPodInfo)
- 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" )
Variables ¶
This section is empty.
Functions ¶
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 build number from the given Pod labels
func GetBuildNumberFromLabelsFileData ¶ added in v1.3.819
GetBuildNumberFromLabelsFileData parses the /etc/podinfo/labels style downward API file for a pods labels and returns the build number if it can be discovered
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 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 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 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) 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 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)