use of org.jboss.pnc.spi.environment.EnvironmentDriver in project pnc by project-ncl.
the class DefaultBuildExecutor method setUpEnvironment.
private CompletableFuture<Void> setUpEnvironment(DefaultBuildExecutionSession buildExecutionSession, RepositorySession repositorySession, DebugData debugData) {
if (buildExecutionSession.isCanceled()) {
return null;
}
ProcessStageUtils.logProcessStageBegin(BuildExecutionStatus.BUILD_ENV_SETTING_UP.toString(), "Setting up build environment ...");
buildExecutionSession.setStatus(BuildExecutionStatus.BUILD_ENV_SETTING_UP);
BuildExecutionConfiguration buildExecutionConfiguration = buildExecutionSession.getBuildExecutionConfiguration();
try {
EnvironmentDriver envDriver = environmentDriverFactory.getDriver(buildExecutionConfiguration.getSystemImageType());
StartedEnvironment startedEnv = envDriver.startEnvironment(buildExecutionConfiguration.getSystemImageId(), buildExecutionConfiguration.getSystemImageRepositoryUrl(), buildExecutionConfiguration.getSystemImageType(), repositorySession, debugData, buildExecutionSession.getAccessToken(), buildExecutionConfiguration.isTempBuild(), buildExecutionConfiguration.getGenericParameters());
buildExecutionSession.setCancelHook(startedEnv::cancel);
return waitForEnvironmentInitialization(buildExecutionSession, startedEnv);
} catch (Throwable e) {
throw new BuildProcessException(e);
}
}
Aggregations