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 Stringprotected voidstatic StringJoins 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 blankvoidonCompleted(Run run, TaskListener listener) voidvoidonFinalized(Run run) voidonStarted(Run run, TaskListener listener) protected voidpollLoop()protected booleanprotected booleanshouldPollRun(Run run) Returns true if we should poll the status of this runMethods inherited from class hudson.model.listeners.RunListener
all, allowLoad, 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:
onStartedin classRunListener<Run>
-
checkTimerStarted
protected void checkTimerStarted() -
onCompleted
- Overrides:
onCompletedin classRunListener<Run>
-
onDeleted
- Overrides:
onDeletedin classRunListener<Run>
-
onFinalized
- Overrides:
onFinalizedin 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
-