jx: github.com/jenkins-x/jx/pkg/builds Index | Files

package builds

import "github.com/jenkins-x/jx/pkg/builds"

Index

Package Files

build_info.go build_logs.go build_number.go buildpacks.go constants.go helpers.go jenkinsfiles.go

Constants

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"
)

func GetBranchName Uses

func GetBranchName() string

GetBranchName returns the branch name using environment variables and/or pod Downward API

func GetBranchNameFromLabels Uses

func GetBranchNameFromLabels(m map[string]string) string

GetBranchNameFromLabels returns the branch name from the given pod labels

func GetBuildLogsForPod Uses

func GetBuildLogsForPod(podInterface v1.PodInterface, pod *corev1.Pod) ([]byte, error)

GetBuildLogsForPod returns the pod log for a Knative Build style build pod which is based on init containers

func GetBuildNumber Uses

func GetBuildNumber() string

GetBuildNumber returns the build number using environment variables and/or pod Downward API files

func GetBuildNumberFromLabels Uses

func GetBuildNumberFromLabels(m map[string]string) string

GetBuildNumberFromLabels returns the

func GetBuildNumberFromLabelsWithKeys Uses

func GetBuildNumberFromLabelsWithKeys(m map[string]string, keys ...string) string

GetBuildNumberFromLabelsWithKeys returns the build number from the given Pod labels

func GetBuildPacks Uses

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 Uses

func GetBuildPods(kubeClient kubernetes.Interface, ns string) ([]*corev1.Pod, error)

GetBuildPods returns all the build pods in the given namespace

func GetPipelineRunPods Uses

func GetPipelineRunPods(kubeClient kubernetes.Interface, ns string, prName string) ([]*corev1.Pod, error)

GetPipelineRunPods gets the pods for a given PipelineRun name.

func GetValueFromLabels Uses

func GetValueFromLabels(m map[string]string, keys ...string) string

GetValueFromLabels returns the first label with the given key

func LoadDownwardAPILabels Uses

func LoadDownwardAPILabels(text string) map[string]string

LoadDownwardAPILabels parses the /etc/podinfo/labels text into a map of label values

func SortBuildPacks Uses

func SortBuildPacks(buildPacks []v1.BuildPack)

SortBuildPacks sorts the build packs in order

func SortBuildPodInfos Uses

func SortBuildPodInfos(buildPodInfos []*BuildPodInfo)

type BaseBuildInfo Uses

type BaseBuildInfo interface {
    GetBuild() string
}

BaseBuildInfo is an interface that is implemented by both BuildPodInfo here and tekton.PipelineRunInfo

type BuildPackOrder Uses

type BuildPackOrder []v1.BuildPack

BuildPackOrder used to sort the build packs in label order

func (BuildPackOrder) Len Uses

func (a BuildPackOrder) Len() int

func (BuildPackOrder) Less Uses

func (a BuildPackOrder) Less(i, j int) bool

func (BuildPackOrder) Swap Uses

func (a BuildPackOrder) Swap(i, j int)

type BuildPodInfo Uses

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 Uses

func CreateBuildPodInfo(pod *corev1.Pod) *BuildPodInfo

CreateBuildPodInfo creates a BuildPodInfo from a Pod

func (BuildPodInfo) GetBuild Uses

func (b BuildPodInfo) GetBuild() string

GetBuild gets the build identifier

func (*BuildPodInfo) MatchesPipeline Uses

func (b *BuildPodInfo) MatchesPipeline(activity *v1.PipelineActivity) bool

MatchesPipeline returns true if this build info matches the given pipeline

func (*BuildPodInfo) Status Uses

func (b *BuildPodInfo) Status() string

Status returns the build status

type BuildPodInfoFilter Uses

type BuildPodInfoFilter struct {
    Owner      string
    Repository string
    Branch     string
    Build      string
    Filter     string
    Pod        string
    Pending    bool
    Context    string
}

func (*BuildPodInfoFilter) BuildMatches Uses

func (o *BuildPodInfoFilter) BuildMatches(info *BuildPodInfo) bool

BuildMatches returns true if the build info matches the filter

func (*BuildPodInfoFilter) BuildNumber Uses

func (o *BuildPodInfoFilter) BuildNumber() int

BuildNumber returns the integer build number filter if specified

func (*BuildPodInfoFilter) LabelSelectorsForActivity Uses

func (o *BuildPodInfoFilter) LabelSelectorsForActivity() []string

LabelSelectorsForActivity returns a slice of label selectors relevant to PipelineActivity corresponding to the filter

func (*BuildPodInfoFilter) LabelSelectorsForBuild Uses

func (o *BuildPodInfoFilter) LabelSelectorsForBuild() []string

LabelSelectorsForBuild returns a slice of label selectors corresponding to the filter

type BuildPodInfoOrder Uses

type BuildPodInfoOrder []*BuildPodInfo

func (BuildPodInfoOrder) Len Uses

func (a BuildPodInfoOrder) Len() int

func (BuildPodInfoOrder) Less Uses

func (a BuildPodInfoOrder) Less(i, j int) bool

func (BuildPodInfoOrder) Swap Uses

func (a BuildPodInfoOrder) Swap(i, j int)

type JenkinsConverter Uses

type JenkinsConverter struct {
    Indentation          string
    KubernetesPluginMode bool
    ProjectConfig        *config.ProjectConfig
    // contains filtered or unexported fields
}

func NewJenkinsConverter Uses

func NewJenkinsConverter(projectConfig *config.ProjectConfig) *JenkinsConverter

NewJenkinsConverter creates a new JenkinsConverter instance

func (*JenkinsConverter) String Uses

func (j *JenkinsConverter) String() string

func (*JenkinsConverter) ToJenkinsfile Uses

func (j *JenkinsConverter) ToJenkinsfile() (string, error)

Package builds imports 24 packages (graph) and is imported by 13 packages. Updated 2019-09-13. Refresh now. Tools for package owners.