|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjetbrains.buildServer.agent.runner.CommandLineBuildService
public abstract class CommandLineBuildService
Represents process run parameters that
AgentRunningBuild.getFailBuildOnExitCode()
build configuration optionLoggingProcessListener to
log all process output to the build logBuildServiceAdapter to simplify code.
| Constructor Summary | |
|---|---|
CommandLineBuildService()
|
|
| Method Summary | |
|---|---|
void |
afterInitialized()
called after the service is initialized and all necessary dependencies are injected. |
void |
afterProcessFinished()
this method is called after process finished and before getRunResult called. |
void |
afterProcessSuccessfullyFinished()
this method is called after process has successfully finished, meaning getRunResult(int) returned BuildFinishedStatus.FINISHED_SUCCESS
Not called in case of build interruption. |
void |
beforeProcessStarted()
this method is called before creation commandline preparation started |
protected AgentRunningBuild |
getBuild()
|
java.util.List<ProcessListener> |
getListeners()
Build process event listeners To log all process output to the build log consider using LoggingProcessListener
To log only latest lines from
class |
protected BuildProgressLogger |
getLogger()
|
protected BuildRunnerContext |
getRunnerContext()
|
BuildFinishedStatus |
getRunResult(int exitCode)
This method is called if process was not interrupted by build agent. |
void |
initialize(AgentRunningBuild build,
BuildRunnerContext runner)
Makes the second phase of initialization. |
TerminationAction |
interrupt()
called only if build is about to be interrupted by TeamCity. |
boolean |
isCommandLineLoggingEnabled()
|
abstract ProgramCommandLine |
makeProgramCommandLine()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CommandLineBuildService()
| Method Detail |
|---|
public final void initialize(@NotNull
AgentRunningBuild build,
@NotNull
BuildRunnerContext runner)
throws RunBuildException
build - build on agentrunner - runner context containing actual paramers for the run
RunBuildException - to break the build
public void afterInitialized()
throws RunBuildException
RunBuildException - to break the build
public void beforeProcessStarted()
throws RunBuildException
RunBuildException - to break the build
public void afterProcessFinished()
throws RunBuildException
BuildFinishedStatus. If
you need changing BuildFinishedStatus
consider using getRunResult(int) method instead.
This method is called strictly before getRunResult(int)
RunBuildException - to break the build
public void afterProcessSuccessfullyFinished()
throws RunBuildException
getRunResult(int) returned BuildFinishedStatus.FINISHED_SUCCESS
Not called in case of build interruption. NOTE: The result of this method depends
on AgentRunningBuild.getFailBuildOnExitCode(),
if you need more predictable behaviour, override this method.
This is a good place to run any post-build activity the does not
alter BuildFinishedStatus and that
should only be started if the build succeeded. If
you need changing BuildFinishedStatus
consider using getRunResult(int) method instead.
This method is called strictly before getRunResult(int) and afterProcessFinished()
RunBuildException - to break the build
@NotNull
public abstract ProgramCommandLine makeProgramCommandLine()
throws RunBuildException
RunBuildException - to break the build@NotNull public java.util.List<ProcessListener> getListeners()
LoggingProcessListener
To log only latest lines from
class
@NotNull public TerminationAction interrupt()
@NotNull public BuildFinishedStatus getRunResult(int exitCode)
BuildFinishedStatus. If
you do not need changing BuildFinishedStatus
consider using afterProcessFinished() method instead.
This method is called strictly after afterProcessFinished()
NOTE: The result of this method depends on AgentRunningBuild.getFailBuildOnExitCode(),
if you need more predictable behaviour, override this method.
exitCode - started process exit code
public boolean isCommandLineLoggingEnabled()
@NotNull protected final AgentRunningBuild getBuild()
@NotNull protected final BuildRunnerContext getRunnerContext()
@NotNull protected final BuildProgressLogger getLogger()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||