public class Utils extends Object
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
protected static RegEx |
checkBuild(hudson.model.Run<?,?> build)
Checks if a certain build matches any of the given regular expressions.
|
protected static boolean |
checkBuild(hudson.model.Run<?,?> build,
BuildFailureObject bfa)
Checks if a certain build matches the given Build Failure Cause.
|
protected static boolean |
checkBuild(hudson.model.Run<?,?> build,
RegEx regEx)
Checks if a certain build matches the given regular expression.
|
protected static BuildFailureObject |
checkBuildForBuildFailure(hudson.model.Run<?,?> build)
Checks if a certain build matches any of the given Failure Cause.
|
protected static void |
execAction(hudson.model.AbstractProject<?,?> project,
String nodeAction,
String masterAction)
Executes script actions for a given project.
|
static List<com.sonyericsson.jenkins.plugins.bfa.model.FailureCause> |
getAvailableFailureCauses()
Reads all available failure causes from Build Failure Analyzer Plugin.
|
static List<String> |
getAvailableFailureCausesIds()
Returns all available failure cause ids as string from Build Failure
Analyzer Plugin.
|
static List<String> |
getAvailableFailureCausesIds(boolean names)
Reads all available failure causes from Build Failure Analyzer Plugin.
|
static com.sonyericsson.jenkins.plugins.bfa.model.FailureCause |
getFailureCauseById(String id)
Searches for a FailureCause by its ID
|
static boolean |
isBfaAvailable()
Determine if the plugin build-failure-analyzer is available
|
protected static boolean |
isMavenPluginAvailable() |
protected static boolean |
qualifyForUnchangedRestart(hudson.model.AbstractProject<?,?> project)
If there were no changes between the last 2 builds of a project and the
last build failed but the previous didn't, then this project is being
restarted if this unchanged restart option is enabled.
|
protected static void |
restart(hudson.model.AbstractProject<?,?> project,
String cause,
PeriodicTrigger perTri,
int quietPeriod)
Helper method for restarting a project.
|
protected static boolean qualifyForUnchangedRestart(hudson.model.AbstractProject<?,?> project)
project
- the project.protected static void restart(hudson.model.AbstractProject<?,?> project, String cause, PeriodicTrigger perTri, int quietPeriod)
project
- the project.cause
- the cause for the restart.perTri
- periodic trigger.quietPeriod
- amount of time a job will wait in the queue(in seconds).IOException
InterruptedException
protected static RegEx checkBuild(hudson.model.Run<?,?> build)
build
- the build.protected static BuildFailureObject checkBuildForBuildFailure(hudson.model.Run<?,?> build)
build
- the build.protected static boolean checkBuild(hudson.model.Run<?,?> build, RegEx regEx)
build
- the build.regEx
- the regular expression.protected static boolean checkBuild(hudson.model.Run<?,?> build, BuildFailureObject bfa)
build
- the build.regEx
- the regular expression.public static boolean isBfaAvailable()
protected static void execAction(hudson.model.AbstractProject<?,?> project, String nodeAction, String masterAction) throws IOException, InterruptedException
project
- the projectnodeAction
- the nodeActionmasterAction
- the masterActionIOException
- input/output problemInterruptedException
- interrupt exceptionpublic static com.sonyericsson.jenkins.plugins.bfa.model.FailureCause getFailureCauseById(String id)
public static List<String> getAvailableFailureCausesIds()
public static List<String> getAvailableFailureCausesIds(boolean names)
true
- if string should contain name, false if it should contain idpublic static List<com.sonyericsson.jenkins.plugins.bfa.model.FailureCause> getAvailableFailureCauses()
protected static boolean isMavenPluginAvailable()
Copyright © 2016–2019. All rights reserved.