Package io.fabric8.jenkins.openshiftsync
Class BuildSyncRunListener
- All Implemented Interfaces:
ExtensionPoint
Listens to Jenkins Job build
Run
start and stop then ensure there's a
suitable Build
object in OpenShift thats updated correctly with the
current status, logsURL and metrics-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Fields inherited from class hudson.model.listeners.RunListener
LISTENERS, targetType
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static String
protected void
static String
Joins all the given strings, ignoring nulls so that they form a URL with / between the paths without a // if the previous path ends with / and the next path starts with / unless a path item is blankvoid
onCompleted
(Run run, TaskListener listener) void
void
onFinalized
(Run run) void
onStarted
(Run run, TaskListener listener) protected void
pollLoop()
protected boolean
protected boolean
shouldPollRun
(Run run) Returns true if we should poll the status of this runMethods inherited from class hudson.model.listeners.RunListener
all, fireCompleted, fireDeleted, fireFinalized, fireInitialize, fireStarted, onInitialize, register, setUpEnvironment, unregister
-
Constructor Details
-
BuildSyncRunListener
public BuildSyncRunListener() -
BuildSyncRunListener
@DataBoundConstructor public BuildSyncRunListener(long pollPeriodMs)
-
-
Method Details
-
joinPaths
Joins all the given strings, ignoring nulls so that they form a URL with / between the paths without a // if the previous path ends with / and the next path starts with / unless a path item is blank- Parameters:
strings
- the sequence of strings to join- Returns:
- the strings concatenated together with / while avoiding a double // between non blank strings.
-
onStarted
- Overrides:
onStarted
in classRunListener<Run>
-
checkTimerStarted
protected void checkTimerStarted() -
onCompleted
- Overrides:
onCompleted
in classRunListener<Run>
-
onDeleted
- Overrides:
onDeleted
in classRunListener<Run>
-
onFinalized
- Overrides:
onFinalized
in classRunListener<Run>
-
pollLoop
protected void pollLoop() -
pollRun
-
asJSON
protected static String asJSON(Object obj) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
shouldPollRun
Returns true if we should poll the status of this run- Parameters:
run
- the Run to test against- Returns:
- true if the should poll the status of this build run
-