Documentation ¶
Index ¶
- Constants
- func CreateTempFile(data string) (string, error)
- func DumpLogs(oc *exutil.CLI, t *exutil.BuildResult) (string, error)
- func FindJenkinsPod(oc *exutil.CLI) *corev1.Pod
- func OverridePodTemplateImages(newAppArgs []string) []string
- func ProcessLogURLAnnotations(oc *exutil.CLI, t *exutil.BuildResult) (*url.URL, error)
- func SetupDockerhubImage(localImageName, snapshotImageStream string, newAppArgs []string, ...) []string
- func SetupSnapshotImage(envVarName, localImageName, snapshotImageStream string, newAppArgs []string, ...) ([]string, bool)
- func StartJenkinsGCTracking(oc *exutil.CLI, jenkinsNamespace string) *time.Ticker
- func StartJenkinsMemoryTracking(oc *exutil.CLI, jenkinsNamespace string) *time.Ticker
- type Definition
- type FlowDefinition
- type JenkinsRef
- func (j *JenkinsRef) BuildDSLJob(namespace string, scriptLines ...string) (string, error)
- func (j *JenkinsRef) BuildURI(resourcePathFormat string, a ...interface{}) string
- func (j *JenkinsRef) CreateItem(name string, itemDefXML string)
- func (j *JenkinsRef) GetJobBuildNumber(name string, timeout time.Duration) (string, error)
- func (j *JenkinsRef) GetJobConsoleLogs(jobName, buildNumber string) (string, error)
- func (j *JenkinsRef) GetJobConsoleLogsAndMatchViaBuildResult(br *exutil.BuildResult, match string) (string, error)
- func (j *JenkinsRef) GetLastJobConsoleLogs(jobName string) (string, error)
- func (j *JenkinsRef) GetResource(resourcePathFormat string, a ...interface{}) (string, int, error)
- func (j *JenkinsRef) GetResourceWithStatus(validStatusList []int, timeout time.Duration, resourcePathFormat string, ...) (string, int, error)
- func (j *JenkinsRef) Namespace() string
- func (j *JenkinsRef) Post(reqBodyFile, resourcePathFormat, contentType string, a ...interface{}) (string, int, error)
- func (j *JenkinsRef) PostXML(reqBodyFile, resourcePathFormat string, a ...interface{}) (string, int, error)
- func (j *JenkinsRef) ProcessJenkinsJob(filename, namespace string) string
- func (j *JenkinsRef) ProcessJenkinsJobUsingVars(filename, namespace string, vars map[string]string) string
- func (j *JenkinsRef) StartJob(jobName string) *JobMon
- func (j *JenkinsRef) WaitForContent(verificationRegEx string, verificationStatus int, timeout time.Duration, ...) (string, error)
- type JobMon
Constants ¶
const ( EnableJenkinsMemoryStats = "ENABLE_JENKINS_MEMORY_MONITORING" EnableJenkinsGCStats = "ENABLE_JENKINS_GC_MONITORING" )
const ( UseLocalPluginSnapshotEnvVarName = "USE_SNAPSHOT_JENKINS_IMAGE" UseLocalClientPluginSnapshotEnvVarName = "USE_SNAPSHOT_JENKINS_CLIENT_IMAGE" UseLocalSyncPluginSnapshotEnvVarName = "USE_SNAPSHOT_JENKINS_SYNC_IMAGE" UseLocalLoginPluginSnapshotEnvVarName = "USE_SNAPSHOT_JENKINS_LOGIN_IMAGE" )
Variables ¶
This section is empty.
Functions ¶
func CreateTempFile ¶
CreateTempFile stores the specified data in a temp dir/temp file for the test who calls it
func OverridePodTemplateImages ¶
OverridePodTemplateImages sees if this is a prow-gcp e2e test invocation, and we want to override the agent image for the default pod templates; the jenkins image will pick up the env vars passed to new-app and update the image field of the pod templates with the values
func SetupDockerhubImage ¶
func SetupDockerhubImage(localImageName, snapshotImageStream string, newAppArgs []string, oc *exutil.CLI) []string
SetupDockerhubImage pull in a jenkins image from docker.io for aws-build testing; at some point during 4.0 dev, the jenkins imagestream in the openshift namespace will leverage the rhel images from the terms based registry at registry.redhat.io where credentials will be needed; we want to test against pre-release images
func SetupSnapshotImage ¶
func SetupSnapshotImage(envVarName, localImageName, snapshotImageStream string, newAppArgs []string, oc *exutil.CLI) ([]string, bool)
pulls in a jenkins image built from a PR change for one of our plugins
func StartJenkinsGCTracking ¶
Types ¶
type Definition ¶
type Definition struct { XMLName xml.Name `xml:"definition"` Class string `xml:"class,attr"` Plugin string `xml:"plugin,attr"` Script string `xml:"script"` }
Definition is part of a FlowDefinition
type FlowDefinition ¶
type FlowDefinition struct { XMLName xml.Name `xml:"flow-definition"` Plugin string `xml:"plugin,attr"` KeepDependencies bool `xml:"keepDependencies"` Definition Definition }
FlowDefinition can be marshalled into XML to represent a Jenkins workflow job definition.
type JenkinsRef ¶
type JenkinsRef struct {
// contains filtered or unexported fields
}
JenkinsRef represents a Jenkins instance running on an OpenShift server
func NewRef ¶
func NewRef(oc *exutil.CLI) *JenkinsRef
NewRef creates a jenkins reference from an OC client
func (*JenkinsRef) BuildDSLJob ¶
func (j *JenkinsRef) BuildDSLJob(namespace string, scriptLines ...string) (string, error)
BuildDSLJob returns an XML string defining a Jenkins workflow/pipeline DSL job. Instances of the string "PROJECT_NAME" are replaced with the specified namespace.
func (*JenkinsRef) BuildURI ¶
func (j *JenkinsRef) BuildURI(resourcePathFormat string, a ...interface{}) string
BuildURI builds a URI for the Jenkins server.
func (*JenkinsRef) CreateItem ¶
func (j *JenkinsRef) CreateItem(name string, itemDefXML string)
CreateItem submits XML to create a named item on the Jenkins server.
func (*JenkinsRef) GetJobBuildNumber ¶
GetJobBuildNumber returns the current buildNumber on the named project OR "new" if there are no builds against a job yet.
func (*JenkinsRef) GetJobConsoleLogs ¶
func (j *JenkinsRef) GetJobConsoleLogs(jobName, buildNumber string) (string, error)
GetJobConsoleLogs returns the console logs of a particular buildNumber.
func (*JenkinsRef) GetJobConsoleLogsAndMatchViaBuildResult ¶
func (j *JenkinsRef) GetJobConsoleLogsAndMatchViaBuildResult(br *exutil.BuildResult, match string) (string, error)
GetJobConsoleLogsAndMatchViaBuildResult leverages various information in the BuildResult and returns the corresponding console logs, as well as look for matching string
func (*JenkinsRef) GetLastJobConsoleLogs ¶
func (j *JenkinsRef) GetLastJobConsoleLogs(jobName string) (string, error)
GetLastJobConsoleLogs returns the last build associated with a Jenkins job.
func (*JenkinsRef) GetResource ¶
func (j *JenkinsRef) GetResource(resourcePathFormat string, a ...interface{}) (string, int, error)
GetResource submits a GET request to this Jenkins server. Returns a response body and status code or an error.
func (*JenkinsRef) GetResourceWithStatus ¶
func (j *JenkinsRef) GetResourceWithStatus(validStatusList []int, timeout time.Duration, resourcePathFormat string, a ...interface{}) (string, int, error)
GetResourceWithStatus repeatedly tries to GET a jenkins resource with an acceptable HTTP status. Retries for the specified duration.
func (*JenkinsRef) Namespace ¶
func (j *JenkinsRef) Namespace() string
Namespace returns the Jenkins namespace
func (*JenkinsRef) Post ¶
func (j *JenkinsRef) Post(reqBodyFile, resourcePathFormat, contentType string, a ...interface{}) (string, int, error)
Post sends a POST to the Jenkins server. Returns response body and status code or an error.
func (*JenkinsRef) PostXML ¶
func (j *JenkinsRef) PostXML(reqBodyFile, resourcePathFormat string, a ...interface{}) (string, int, error)
PostXML sends a POST to the Jenkins server. If a body is specified, it should be XML. Returns response body and status code or an error.
func (*JenkinsRef) ProcessJenkinsJob ¶
func (j *JenkinsRef) ProcessJenkinsJob(filename, namespace string) string
ProcessJenkinsJob returns the path of the modified Jenkins job XML file. Instances of the string "PROJECT_NAME" are replaced with the specified namespace.
func (*JenkinsRef) ProcessJenkinsJobUsingVars ¶
func (j *JenkinsRef) ProcessJenkinsJobUsingVars(filename, namespace string, vars map[string]string) string
ProcessJenkinsJobUsingVars returns the path of the modified Jenkins job XML file. Instances of the string "PROJECT_NAME" are replaced with the specified namespace. Variables named in the vars map will also be replaced with their corresponding value.
func (*JenkinsRef) StartJob ¶
func (j *JenkinsRef) StartJob(jobName string) *JobMon
StartJob triggers a named Jenkins job. The job can be monitored with the returned object.
func (*JenkinsRef) WaitForContent ¶
func (j *JenkinsRef) WaitForContent(verificationRegEx string, verificationStatus int, timeout time.Duration, resourcePathFormat string, a ...interface{}) (string, error)
WaitForContent waits for a particular HTTP status and HTML matching a particular pattern to be returned by this Jenkins server. An error will be returned if the condition is not matched within the timeout period.