Search in sources :

Example 1 with EnvironmentDriver

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);
    }
}
Also used : BuildExecutionConfiguration(org.jboss.pnc.spi.executor.BuildExecutionConfiguration) EnvironmentDriver(org.jboss.pnc.spi.environment.EnvironmentDriver) StartedEnvironment(org.jboss.pnc.spi.environment.StartedEnvironment) BuildProcessException(org.jboss.pnc.executor.exceptions.BuildProcessException)

Aggregations

BuildProcessException (org.jboss.pnc.executor.exceptions.BuildProcessException)1 EnvironmentDriver (org.jboss.pnc.spi.environment.EnvironmentDriver)1 StartedEnvironment (org.jboss.pnc.spi.environment.StartedEnvironment)1 BuildExecutionConfiguration (org.jboss.pnc.spi.executor.BuildExecutionConfiguration)1