Class NaginatorScheduleAction
- java.lang.Object
-
- hudson.model.InvisibleAction
-
- com.chikli.hudson.plugin.naginator.NaginatorScheduleAction
-
- All Implemented Interfaces:
Action
,ModelObject
- Direct Known Subclasses:
NaginatorPublisherScheduleAction
public class NaginatorScheduleAction extends InvisibleAction
Action
to mark a build to be rescheduled byNaginatorListener
. Be aware that you have to add this action to the parent build if the build is the child of another build (e.g. multi-configuration projects).
-
-
Constructor Summary
Constructors Constructor Description NaginatorScheduleAction()
Should always reschedule the build.NaginatorScheduleAction(int maxSchedule)
Should reschedule the build for specified times.NaginatorScheduleAction(int maxSchedule, ScheduleDelay delay, boolean rerunMatrixPart)
Should reschedule the build for specified times.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScheduleDelay
getDelay()
int
getMaxSchedule()
The max times to reschedule the build.NoChildStrategy
getNoChildStrategy()
boolean
isRerunMatrixPart()
boolean
shouldSchedule(Run<?,?> run, TaskListener listener, int retryCount)
Tests whetherNaginatorListener
should reschedule the build.boolean
shouldScheduleForMatrixRun(hudson.matrix.MatrixRun run, TaskListener listener)
A test for each child builds of multi-configuration builds.-
Methods inherited from class hudson.model.InvisibleAction
getDisplayName, getIconFileName, getUrlName
-
-
-
-
Constructor Detail
-
NaginatorScheduleAction
public NaginatorScheduleAction()
Should always reschedule the build.
-
NaginatorScheduleAction
public NaginatorScheduleAction(int maxSchedule)
Should reschedule the build for specified times.- Parameters:
maxSchedule
- max times to reschedule the build. Less or equal to 0 indicates "always".
-
NaginatorScheduleAction
public NaginatorScheduleAction(int maxSchedule, @CheckForNull ScheduleDelay delay, boolean rerunMatrixPart)
Should reschedule the build for specified times.- Parameters:
maxSchedule
- max times to reschedule the build. Less or equal to 0 indicates "always".delay
- A scheduling policy to trigger a new build.rerunMatrixPart
- tests matrix child builds and triggers only failed parts.
-
-
Method Detail
-
getMaxSchedule
public int getMaxSchedule()
The max times to reschedule the build. Less or equal to 0 indicates "always".- Returns:
- the max times to reschedule the build.
-
getDelay
@NonNull public ScheduleDelay getDelay()
- Returns:
- A scheduling policy to trigger a new build
-
isRerunMatrixPart
public boolean isRerunMatrixPart()
- Returns:
- whether to test each child builds to reschedule for multi-configuration builds.
-
shouldSchedule
public boolean shouldSchedule(@NonNull Run<?,?> run, @NonNull TaskListener listener, int retryCount)
Tests whetherNaginatorListener
should reschedule the build. You can override this method to reschedule the build conditionally.retryCount
is passed with 0 when this is the first time to reschedule the build.- Parameters:
run
- a build to test. never be aMatrixRun
listener
- The listener for this build. This can be used to produce log messages, for example, which becomes a part of the "console output" of this build. But when this method runs, the build is considered completed, so its status cannot be changed anymore.retryCount
- the count the build is rescheduled.- Returns:
- whether to reschedule the build.
-
shouldScheduleForMatrixRun
public boolean shouldScheduleForMatrixRun(@NonNull hudson.matrix.MatrixRun run, @NonNull TaskListener listener)
A test for each child builds of multi-configuration builds. You can filter child builds to reschedule.- Parameters:
run
- multi-configuration build to test- Returns:
true
if should be scheduled
-
getNoChildStrategy
@NonNull public NoChildStrategy getNoChildStrategy()
- Returns:
- how to do when no children to rerun for a matrix project.
- Since:
- 1.17
-
-