Search in sources :

Example 11 with CompletedBuild

use of org.jboss.pnc.spi.builddriver.CompletedBuild in project pnc by project-ncl.

the class TermdBuildDriver method complete.

private void complete(TermdRunningBuild termdRunningBuild, RemoteInvocationCompletion completion, FileTransfer fileTransfer) {
    if (completion.getException() != null) {
        logger.warn("Completed with exception.", completion.getException());
        termdRunningBuild.setBuildError(completion.getException());
        return;
    }
    CompletedBuild completedBuild = collectResults(termdRunningBuild.getRunningEnvironment(), completion, fileTransfer);
    logger.debug("Command result {}", completedBuild);
    if (completedBuild == null) {
        termdRunningBuild.setBuildError(new BuildDriverException("Completed build should not be null."));
    } else {
        termdRunningBuild.setCompletedBuild(completedBuild);
    }
}
Also used : CompletedBuild(org.jboss.pnc.spi.builddriver.CompletedBuild) BuildDriverException(org.jboss.pnc.spi.builddriver.exception.BuildDriverException)

Aggregations

CompletedBuild (org.jboss.pnc.spi.builddriver.CompletedBuild)11 RunningEnvironment (org.jboss.pnc.spi.environment.RunningEnvironment)10 BuildDriverException (org.jboss.pnc.spi.builddriver.exception.BuildDriverException)9 Consumer (java.util.function.Consumer)8 SystemConfig (org.jboss.pnc.common.json.moduleconfig.SystemConfig)8 RunningBuild (org.jboss.pnc.spi.builddriver.RunningBuild)8 BuildExecutionSession (org.jboss.pnc.spi.executor.BuildExecutionSession)8 Logger (org.slf4j.Logger)8 LoggerFactory (org.slf4j.LoggerFactory)8 BuildExecutionConfiguration (org.jboss.pnc.spi.executor.BuildExecutionConfiguration)7 Status (org.jboss.pnc.buildagent.api.Status)5 ConfigurationParseException (org.jboss.pnc.common.json.ConfigurationParseException)5 DebugData (org.jboss.pnc.spi.builddriver.DebugData)5 AtomicReference (java.util.concurrent.atomic.AtomicReference)4 BuildStatus (org.jboss.pnc.enums.BuildStatus)4 Paths (java.nio.file.Paths)3 Optional (java.util.Optional)3 CompletableFuture (java.util.concurrent.CompletableFuture)3 ExecutorService (java.util.concurrent.ExecutorService)3 TimeUnit (java.util.concurrent.TimeUnit)3