Documentation ¶
Overview ¶
Package v1alpha1 contains LighthouseJob +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/jenkins-x/lighthouse/pkg/apis/lighthouse +k8s:defaulter-gen=TypeMeta +groupName=lighthouse.jenkins.io
Index ¶
- Constants
- Variables
- func Kind(kind string) schema.GroupKind
- func Resource(resource string) schema.GroupResource
- type ActivityRecord
- type ActivityStageOrStep
- type ByNum
- type DecorationConfig
- type Duration
- type JenkinsSpec
- type LighthouseJob
- type LighthouseJobList
- type LighthouseJobSpec
- type LighthouseJobStatus
- type PipelineState
- type Pull
- type Refs
Constants ¶
const ( // BuildIDEnv is an optional unique build ID environment variable that can be used by an engine. BuildIDEnv = "BUILD_ID" // JobSpecEnv is a legacy Prow variable with "type:(type)" JobSpecEnv = "JOB_SPEC" // JobNameEnv is the name of the job JobNameEnv = "JOB_NAME" // JobTypeEnv is the type of job JobTypeEnv = "JOB_TYPE" // RepoOwnerEnv is the org/owner for the repository we're building RepoOwnerEnv = "REPO_OWNER" // RepoNameEnv is the name of the repository we're building RepoNameEnv = "REPO_NAME" // RepoURLEnv is the clone URL for the repo we're building RepoURLEnv = "REPO_URL" // PullBaseRefEnv is the base ref (such as master) for a pull request PullBaseRefEnv = "PULL_BASE_REF" // PullBaseShaEnv is the actual commit sha for the base for a pull request PullBaseShaEnv = "PULL_BASE_SHA" // PullRefsEnv is the refs and shas for the base and PR, like "master:abcd1234...,123:5678abcd..." for PR-123. PullRefsEnv = "PULL_REFS" // PullPullRefEnv is the batch refs, if needed, in a format suitable for the `git-batch-merge` task. PullPullRefEnv = "PULL_PULL_REF" // PullNumberEnv is the pull request number PullNumberEnv = "PULL_NUMBER" // PullPullShaEnv is the pull request's sha PullPullShaEnv = "PULL_PULL_SHA" )
Environment variables to be added to the pipeline we kick off
Variables ¶
var ( // SchemeBuilder collects functions that add things to a scheme. SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme applies all the stored functions to the scheme. AddToScheme = SchemeBuilder.AddToScheme )
var SchemeGroupVersion = schema.GroupVersion{Group: lighthouse.GroupName, Version: "v1alpha1"}
SchemeGroupVersion is group version used to register these objects
Functions ¶
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group qualified GroupResource
Types ¶
type ActivityRecord ¶ added in v0.0.677
type ActivityRecord struct { Name string `json:"name"` JobID string `json:"jobId,omitempty"` Owner string `json:"owner,omitempty"` Repo string `json:"repo,omitempty"` Branch string `json:"branch,omitempty"` BuildIdentifier string `json:"buildId,omitempty"` Context string `json:"context,omitempty"` GitURL string `json:"gitURL,omitempty"` LogURL string `json:"logURL,omitempty"` LinkURL string `json:"linkURL,omitempty"` Status PipelineState `json:"status,omitempty"` BaseSHA string `json:"baseSHA,omitempty"` LastCommitSHA string `json:"lastCommitSHA,omitempty"` StartTime *metav1.Time `json:"startTime,omitempty"` CompletionTime *metav1.Time `json:"completionTime,omitempty"` Stages []*ActivityStageOrStep `json:"stages,omitempty"` Steps []*ActivityStageOrStep `json:"steps,omitEmpty"` }
ActivityRecord is a struct for reporting information on a pipeline, build, or other activity triggered by Lighthouse
func (*ActivityRecord) DeepCopy ¶ added in v0.0.677
func (in *ActivityRecord) DeepCopy() *ActivityRecord
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ActivityRecord.
func (*ActivityRecord) DeepCopyInto ¶ added in v0.0.677
func (in *ActivityRecord) DeepCopyInto(out *ActivityRecord)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ActivityRecord) RunningStages ¶ added in v0.0.677
func (a *ActivityRecord) RunningStages() []string
RunningStages returns the list of stages currently running
type ActivityStageOrStep ¶ added in v0.0.677
type ActivityStageOrStep struct { Name string `json:"name"` Status PipelineState `json:"status"` StartTime *metav1.Time `json:"startTime,omitempty"` CompletionTime *metav1.Time `json:"completionTime,omitempty"` Stages []*ActivityStageOrStep `json:"stages,omitempty"` Steps []*ActivityStageOrStep `json:"steps,omitempty"` }
ActivityStageOrStep represents a stage of an activity
func (*ActivityStageOrStep) DeepCopy ¶ added in v0.0.677
func (in *ActivityStageOrStep) DeepCopy() *ActivityStageOrStep
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ActivityStageOrStep.
func (*ActivityStageOrStep) DeepCopyInto ¶ added in v0.0.677
func (in *ActivityStageOrStep) DeepCopyInto(out *ActivityStageOrStep)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ByNum ¶
type ByNum []Pull
ByNum implements sort.Interface for []Pull to sort by ascending PR number.
func (ByNum) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ByNum.
func (ByNum) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DecorationConfig ¶
type DecorationConfig struct { // Timeout is how long the pod utilities will wait // before aborting a job with SIGINT. Timeout *Duration `json:"timeout,omitempty"` // GracePeriod is how long the pod utilities will wait // after sending SIGINT to send SIGKILL when aborting // a job. Only applicable if decorating the PodSpec. GracePeriod *Duration `json:"grace_period,omitempty"` // GCSCredentialsSecret is the name of the Kubernetes secret // that holds GCS push credentials. GCSCredentialsSecret string `json:"gcs_credentials_secret,omitempty"` // SSHKeySecrets are the names of Kubernetes secrets that contain // SSK keys which should be used during the cloning process. SSHKeySecrets []string `json:"ssh_key_secrets,omitempty"` // SSHHostFingerprints are the fingerprints of known SSH hosts // that the cloning process can trust. // Launch with ssh-keyscan [-t rsa] host SSHHostFingerprints []string `json:"ssh_host_fingerprints,omitempty"` // SkipCloning determines if we should clone source code in the // initcontainers for jobs that specify refs SkipCloning *bool `json:"skip_cloning,omitempty"` // CookieFileSecret is the name of a kubernetes secret that contains // a git http.cookiefile, which should be used during the cloning process. CookiefileSecret string `json:"cookiefile_secret,omitempty"` }
DecorationConfig specifies how to augment pods.
This is primarily used to provide automatic integration with gubernator and testgrid.
func (*DecorationConfig) DeepCopy ¶
func (in *DecorationConfig) DeepCopy() *DecorationConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DecorationConfig.
func (*DecorationConfig) DeepCopyInto ¶
func (in *DecorationConfig) DeepCopyInto(out *DecorationConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*DecorationConfig) Validate ¶
func (d *DecorationConfig) Validate() error
Validate ensures all the values set in the DecorationConfig are valid.
type Duration ¶
Duration is a wrapper around time.Duration that parses times in either 'integer number of nanoseconds' or 'duration string' formats and serializes to 'duration string' format.
func (*Duration) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Duration.
func (*Duration) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Duration) MarshalJSON ¶
MarshalJSON marshals a duration object to a byte array
func (*Duration) UnmarshalJSON ¶
UnmarshalJSON unmarshal a byte array into a Duration object
type JenkinsSpec ¶ added in v0.0.826
type JenkinsSpec struct {
BranchSourceJob bool `json:"branch_source_job,omitempty"`
}
JenkinsSpec is optional parameters for Jenkins jobs. Currently, the only parameter supported is for telling jenkins-operator that the job is generated by the https://go.cloudbees.com/docs/plugins/github-branch-source/#github-branch-source plugin
func (*JenkinsSpec) DeepCopy ¶ added in v0.0.826
func (in *JenkinsSpec) DeepCopy() *JenkinsSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JenkinsSpec.
func (*JenkinsSpec) DeepCopyInto ¶ added in v0.0.826
func (in *JenkinsSpec) DeepCopyInto(out *JenkinsSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type LighthouseJob ¶
type LighthouseJob struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec LighthouseJobSpec `json:"spec,omitempty"` Status LighthouseJobStatus `json:"status,omitempty"` }
LighthouseJob contains the arguments to create a Jenkins X Pipeline and to report on it
func (*LighthouseJob) Complete ¶ added in v0.0.826
func (j *LighthouseJob) Complete() bool
Complete returns true if the prow job has finished
func (*LighthouseJob) DeepCopy ¶
func (in *LighthouseJob) DeepCopy() *LighthouseJob
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LighthouseJob.
func (*LighthouseJob) DeepCopyInto ¶
func (in *LighthouseJob) DeepCopyInto(out *LighthouseJob)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*LighthouseJob) DeepCopyObject ¶
func (in *LighthouseJob) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*LighthouseJob) SetComplete ¶ added in v0.0.826
func (j *LighthouseJob) SetComplete()
SetComplete marks the job as completed (at time now).
type LighthouseJobList ¶
type LighthouseJobList struct { metav1.TypeMeta `json:",inline"` // +optional metav1.ListMeta `json:"metadata,omitempty"` Items []LighthouseJob `json:"items"` }
LighthouseJobList represents a list of pipeline options
func (*LighthouseJobList) DeepCopy ¶
func (in *LighthouseJobList) DeepCopy() *LighthouseJobList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LighthouseJobList.
func (*LighthouseJobList) DeepCopyInto ¶
func (in *LighthouseJobList) DeepCopyInto(out *LighthouseJobList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*LighthouseJobList) DeepCopyObject ¶
func (in *LighthouseJobList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type LighthouseJobSpec ¶
type LighthouseJobSpec struct { // Type is the type of job and informs how // the jobs is triggered Type job.PipelineKind `json:"type,omitempty"` // Agent is what should run this job, if anything. Agent string `json:"agent,omitempty"` // Namespace defines where to create pods/resources. Namespace string `json:"namespace,omitempty"` // Job is the name of the job Job string `json:"job,omitempty"` // Refs is the code under test, determined at // runtime by Prow itself Refs *Refs `json:"refs,omitempty"` // ExtraRefs are auxiliary repositories that // need to be cloned, determined from config ExtraRefs []Refs `json:"extra_refs,omitempty"` // Context is the name of the status context used to // report back to GitHub Context string `json:"context,omitempty"` // RerunCommand is the command a user would write to // trigger this job on their pull request RerunCommand string `json:"rerun_command,omitempty"` // MaxConcurrency restricts the total number of instances // of this job that can run in parallel at once MaxConcurrency int `json:"max_concurrency,omitempty"` // PipelineRunSpec provides the basis for running the test as a Tekton Pipeline // https://github.com/tektoncd/pipeline PipelineRunSpec *tektonv1beta1.PipelineRunSpec `json:"pipeline_run_spec,omitempty"` // PipelineRunParams are the params used by the pipeline run PipelineRunParams []job.PipelineRunParam `json:"pipeline_run_params,omitempty"` // PodSpec provides the basis for running the test under a Kubernetes agent PodSpec *corev1.PodSpec `json:"pod_spec,omitempty"` // JenkinsSpec holds configuration specific to Jenkins jobs JenkinsSpec *JenkinsSpec `json:"jenkins_spec,omitempty"` }
LighthouseJobSpec the spec of a pipeline request
func (*LighthouseJobSpec) DeepCopy ¶
func (in *LighthouseJobSpec) DeepCopy() *LighthouseJobSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LighthouseJobSpec.
func (*LighthouseJobSpec) DeepCopyInto ¶
func (in *LighthouseJobSpec) DeepCopyInto(out *LighthouseJobSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*LighthouseJobSpec) GetBranch ¶
func (s *LighthouseJobSpec) GetBranch() string
GetBranch returns the branch name corresponding to the refs on this spec.
func (*LighthouseJobSpec) GetEnvVars ¶
func (s *LighthouseJobSpec) GetEnvVars() map[string]string
GetEnvVars gets a map of the environment variables we'll set in the pipeline for this spec.
type LighthouseJobStatus ¶
type LighthouseJobStatus struct { // State is the full state of the job State PipelineState `json:"state,omitempty"` // ActivityName is the name of the PipelineActivity, PipelineRun, etc associated with this job, if any. ActivityName string `json:"activityName,omitempty"` // Description is used for the description of the commit status we report. Description string `json:"description,omitempty"` // ReportURL is the link that will be used in the commit status. ReportURL string `json:"reportURL,omitempty"` // StartTime is when the job was created. StartTime metav1.Time `json:"startTime,omitempty"` // CompletionTime is when the job finished reconciling and entered a terminal state. CompletionTime *metav1.Time `json:"completionTime,omitempty"` // LastReportState is the state from the last time we reported commit status for this job. LastReportState string `json:"lastReportState,omitempty"` // LastCommitSHA is the commit that will be/has been reported to on the SCM provider LastCommitSHA string `json:"lastCommitSHA,omitempty"` // Activity is the most recent activity recorded for the pipeline associated with this job. Activity *ActivityRecord `json:"activity,omitempty"` }
LighthouseJobStatus represents the status of a pipeline
func (*LighthouseJobStatus) DeepCopy ¶
func (in *LighthouseJobStatus) DeepCopy() *LighthouseJobStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LighthouseJobStatus.
func (*LighthouseJobStatus) DeepCopyInto ¶
func (in *LighthouseJobStatus) DeepCopyInto(out *LighthouseJobStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PipelineState ¶
type PipelineState string
PipelineState specifies the current pipelne status
const ( // TriggeredState for pipelines that have been triggered TriggeredState PipelineState = "triggered" // PendingState pipeline is pending PendingState PipelineState = "pending" // RunningState pipeline is running RunningState PipelineState = "running" // SuccessState pipeline is successful SuccessState PipelineState = "success" // FailureState failed FailureState PipelineState = "failure" // AbortedState aborted AbortedState PipelineState = "aborted" // ErrorState means the job could not schedule (bad config, perhaps). ErrorState PipelineState = "error" )
Various job types.
type Pull ¶
type Pull struct { Number int `json:"number"` Author string `json:"author"` SHA string `json:"sha"` Title string `json:"title,omitempty"` // Ref is git ref can be checked out for a change // for example, // github: pull/123/head // gerrit: refs/changes/00/123/1 Ref string `json:"ref,omitempty"` // Link links to the pull request itself. Link string `json:"link,omitempty"` // CommitLink links to the commit identified by the SHA. CommitLink string `json:"commit_link,omitempty"` // AuthorLink links to the author of the pull request. AuthorLink string `json:"author_link,omitempty"` }
Pull describes a pull request at a particular point in time.
func (*Pull) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pull.
func (*Pull) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Refs ¶
type Refs struct { // Org is something like kubernetes or k8s.io Org string `json:"org"` // Repo is something like test-infra Repo string `json:"repo"` // RepoLink links to the source for Repo. RepoLink string `json:"repo_link,omitempty"` BaseRef string `json:"base_ref,omitempty"` BaseSHA string `json:"base_sha,omitempty"` // BaseLink is a link to the commit identified by BaseSHA. BaseLink string `json:"base_link,omitempty"` Pulls []Pull `json:"pulls,omitempty"` // PathAlias is the location under <root-dir>/src // where this repository is cloned. If this is not // set, <root-dir>/src/github.com/org/repo will be // used as the default. PathAlias string `json:"path_alias,omitempty"` // CloneURI is the URI that is used to clone the // repository. If unset, will default to // `https://github.com/org/repo.git`. CloneURI string `json:"clone_uri,omitempty"` // SkipSubmodules determines if submodules should be // cloned when the job is run. Defaults to true. SkipSubmodules bool `json:"skip_submodules,omitempty"` // CloneDepth is the depth of the clone that will be used. // A depth of zero will do a full clone. CloneDepth int `json:"clone_depth,omitempty"` }
Refs describes how the repo was constructed.
func (*Refs) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Refs.
func (*Refs) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.