Class GroovyPostbuildRecorder.BadgeManager
java.lang.Object
org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder.BadgeManager
- Enclosing class:
GroovyPostbuildRecorder
-
Constructor Summary
ConstructorsConstructorDescriptionBadgeManager(Run<?, ?> build, TaskListener listener, Result scriptFailureResult) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidaddErrorBadge(String text) voidaddHtmlBadge(String html) voidaddInfoBadge(String text) voidaddShortText(String text) voidvoidaddWarningBadge(String text) voidvoidbooleanbuildIsA(Class<? extends AbstractBuild<?, ?>> buildClass) Test whether the current build is specified type.voidvoidvoidvoidbooleanDeprecated.booleanDeprecated.com.jenkinsci.plugins.badge.action.BadgeSummaryActioncreateSummary(String icon) Run<?, ?> getBuild()getEnvVariable(String key) Deprecated.getLogMatcher(String regexp) getMatcher(File f, String regexp) Deprecated.getMatcher(File f, Charset charset, String regexp) Deprecated.getMatcher(Reader r, String regexp) booleanlogContains(String regexp) voidvoidremoveBadge(int index) removeBadge(int)isremoveBadgeAction(int)under a historic misnomer name: despite the name, it indexes into badges and summaries together.voidremoveBadgeAction(int index) Removes theAbstractBadgeActionat the givenindexfrom thebuild.voidRemoves everyAbstractBadgeActionobject from thebuild, which includes both actualbadgesseen in the build list column, and thesummariesseen on the build page.
If you want only one of those Action types removed, use the variants constrained to it instead:removeBadgesOnly()for badges only, orremoveSummaries()for summaries only.
Removal in this context means that theActionwould no longer be linked to the specified build.voidremoveBadgeOnly(int index) For details, seeremoveBadgeActions().voidremoveBadges()isremoveBadgeActions()under a historic misnomer name: despite the name, it removes both badges and summaries.voidFor details, seeremoveBadgeActions().voidFor details, seeremoveBadgeActions().voidremoveSummary(int index) For details, seeremoveBadgeActions().voidbooleansetBuildNumber(int buildNumber)
-
Constructor Details
-
BadgeManager
-
-
Method Details
-
getEnvVars
-
println
-
getEnvVariable
- Throws:
IOExceptionInterruptedException
-
getHudson
Deprecated.use $getJenkins()- Returns:
- the jenkins insance
-
getJenkins
-
getBuild
-
setBuild
-
setBuildNumber
public boolean setBuildNumber(int buildNumber) -
getListener
-
addShortText
-
addShortText
-
addBadge
-
addBadge
-
addInfoBadge
-
addWarningBadge
-
addErrorBadge
-
addHtmlBadge
-
getResult
-
removeBadgeActions
public void removeBadgeActions()Removes everyAbstractBadgeActionobject from thebuild, which includes both actualbadgesseen in the build list column, and thesummariesseen on the build page.
If you want only one of those Action types removed, use the variants constrained to it instead:removeBadgesOnly()for badges only, orremoveSummaries()for summaries only.
Removal in this context means that theActionwould no longer be linked to the specified build. An object in the pipeline (if someone gets the reference, e.g. via new Badge Plugin API) may still exist until it is no longer used and gets garbage-collected. Maybe someone can re-add such an Action object to same or different build before it evaporates, though.- See Also:
-
removeBadges
public void removeBadges()removeBadges()isremoveBadgeActions()under a historic misnomer name: despite the name, it removes both badges and summaries. This method is kept for backward compatibility and simply delegates toremoveBadgeActions().
Note: at a future major version,removeBadges()is scheduled to be narrowed to mean whatremoveBadgesOnly()means today, i.e. removingbadgesonly, notsummaries. Callers who want today's behavior (removing everyAbstractBadgeAction, badges and summaries alike) should move toremoveBadgeActions()instead.- See Also:
-
removeBadgeAction
public void removeBadgeAction(int index) Removes theAbstractBadgeActionat the givenindexfrom thebuild. The index is into the combined list of everyAbstractBadgeAction, i.e. both actualbadgesseen in the build list column, and thesummariesseen on the build page. SeeremoveBadgeActions()for what that list contains and what removal means.
Ifindexis out of range, an error is written to thelistenerand nothing is removed.- See Also:
-
removeBadge
public void removeBadge(int index) removeBadge(int)isremoveBadgeAction(int)under a historic misnomer name: despite the name, it indexes into badges and summaries together. This method is kept for backward compatibility and simply delegates toremoveBadgeAction(int).
Note: at a future major version,removeBadge(int)is scheduled to be narrowed to mean whatremoveBadgeOnly(int)means today, i.e. indexing intobadgesonly, notsummaries. Callers who want today's behavior (indexing into everyAbstractBadgeAction, badges and summaries alike) should move toremoveBadgeAction(int)instead.- See Also:
-
removeBadgesOnly
public void removeBadgesOnly()For details, seeremoveBadgeActions().- See Also:
-
removeBadgeOnly
public void removeBadgeOnly(int index) For details, seeremoveBadgeActions().- See Also:
-
createSummary
-
removeSummaries
public void removeSummaries()For details, seeremoveBadgeActions().- See Also:
-
removeSummary
public void removeSummary(int index) For details, seeremoveBadgeActions().- See Also:
-
buildUnstable
public void buildUnstable() -
buildFailure
public void buildFailure() -
buildSuccess
public void buildSuccess() -
buildAborted
public void buildAborted() -
buildNotBuilt
public void buildNotBuilt() -
buildScriptFailed
-
logContains
-
contains
Deprecated. -
contains
Deprecated. -
getLogMatcher
-
getMatcher
Deprecated. -
getMatcher
-
getMatcher
Deprecated. -
buildIsA
Test whether the current build is specified type.- Parameters:
buildClass-- Returns:
- true if the current build is an instance of buildClass
-
getJenkins()