Class BuildSyncRunListener

java.lang.Object
hudson.model.listeners.RunListener<Run>
io.fabric8.jenkins.openshiftsync.BuildSyncRunListener
All Implemented Interfaces:
ExtensionPoint

@Extension public class BuildSyncRunListener extends RunListener<Run>
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
  • Constructor Details

    • BuildSyncRunListener

      public BuildSyncRunListener()
    • BuildSyncRunListener

      @DataBoundConstructor public BuildSyncRunListener(long pollPeriodMs)
  • Method Details

    • joinPaths

      public static String joinPaths(String... strings)
      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

      public void onStarted(Run run, TaskListener listener)
      Overrides:
      onStarted in class RunListener<Run>
    • checkTimerStarted

      protected void checkTimerStarted()
    • onCompleted

      public void onCompleted(Run run, @Nonnull TaskListener listener)
      Overrides:
      onCompleted in class RunListener<Run>
    • onDeleted

      public void onDeleted(Run run)
      Overrides:
      onDeleted in class RunListener<Run>
    • onFinalized

      public void onFinalized(Run run)
      Overrides:
      onFinalized in class RunListener<Run>
    • pollLoop

      protected void pollLoop()
    • pollRun

      protected boolean pollRun(Run run)
    • asJSON

      protected static String asJSON(Object obj) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • shouldPollRun

      protected boolean shouldPollRun(Run run)
      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