private void endBuild( BuildContext buildContext )
throws TaskExecutionException
{
// return build result to master
BuildResult buildResult = buildContext.getBuildResult();
Map<String, Object> result = new HashMap<String, Object>();
result.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, new Integer( buildContext.getProjectId() ) );
result.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, new Integer( buildContext.getBuildDefinitionId() ) );
result.put( ContinuumBuildAgentUtil.KEY_TRIGGER, new Integer( buildContext.getTrigger() ) );
result.put( ContinuumBuildAgentUtil.KEY_BUILD_STATE, new Integer( buildResult.getState() ) );
result.put( ContinuumBuildAgentUtil.KEY_BUILD_START, new Long( buildResult.getStartTime() ).toString() );
result.put( ContinuumBuildAgentUtil.KEY_BUILD_END, new Long( buildResult.getEndTime() ).toString() );
result.put( ContinuumBuildAgentUtil.KEY_BUILD_EXIT_CODE, new Integer( buildResult.getExitCode() ) );
String buildOutput = getBuildOutputText( buildContext.getProjectId() );
if ( buildOutput == null )
{
result.put( ContinuumBuildAgentUtil.KEY_BUILD_OUTPUT, "" );
}
else
{
result.put( ContinuumBuildAgentUtil.KEY_BUILD_OUTPUT, buildOutput );
}
if ( buildResult.getError() != null )
{
result.put( ContinuumBuildAgentUtil.KEY_BUILD_ERROR, buildResult.getError() );
}
else
{
result.put( ContinuumBuildAgentUtil.KEY_BUILD_ERROR, "" );
}