Search in sources :

Example 16 with BuildExecutionConfiguration

use of org.jboss.pnc.spi.executor.BuildExecutionConfiguration in project pnc by project-ncl.

the class DebugInContainerTest method shouldEnableSshWhenBuildFails.

@Test
public void shouldEnableSshWhenBuildFails() throws InterruptedException, BuildDriverException {
    TermdBuildDriverModuleConfig buildDriverModuleConfig = mock(TermdBuildDriverModuleConfig.class);
    doReturn(1000L).when(buildDriverModuleConfig).getLivenessProbeFrequencyMillis();
    doReturn(5000L).when(buildDriverModuleConfig).getLivenessFailTimeoutMillis();
    doReturn(5000).when(buildDriverModuleConfig).getFileTransferReadTimeout();
    ClientMockFactory buildAgentClientFactory = new ClientMockFactory();
    TermdBuildDriver driver = new TermdBuildDriver(systemConfig, buildDriverModuleConfig, buildAgentClientFactory);
    BuildExecutionSession buildExecution = mock(BuildExecutionSession.class);
    BuildExecutionConfiguration buildExecutionConfiguration = mock(BuildExecutionConfiguration.class);
    doReturn(buildExecutionConfiguration).when(buildExecution).getBuildExecutionConfiguration();
    RunningEnvironment runningEnvironment = mock(RunningEnvironment.class);
    doReturn(Paths.get("")).when(runningEnvironment).getWorkingDirectory();
    doReturn(new DebugData(true)).when(runningEnvironment).getDebugData();
    doReturn("http://localhost/").when(runningEnvironment).getInternalBuildAgentUrl();
    doReturn(runningEnvironment).when(buildExecution).getRunningEnvironment();
    BlockingQueue<CompletedBuild> result = new ArrayBlockingQueue(1);
    Consumer<CompletedBuild> onComplete = (completedBuild) -> {
        try {
            result.put(completedBuild);
        } catch (InterruptedException e) {
            Assert.fail("Unable to consume build result.");
        }
    };
    Consumer<Throwable> onError = (throwable) -> Assert.fail("Build should fail without system error.");
    // when
    RunningBuild runningBuild = driver.startProjectBuild(buildExecution, runningEnvironment, onComplete, onError);
    // wait to start waiting for completion and start liveness probe
    Thread.sleep(500);
    buildAgentClientFactory.getOnStatusUpdate().accept(TaskStatusUpdateEvent.newBuilder().newStatus(Status.FAILED).build());
    // then
    CompletedBuild completedBuild = result.poll(3, TimeUnit.SECONDS);
    Assert.assertNotNull("Missing build result.", completedBuild);
    Assert.assertEquals("The build should fail.", BuildStatus.FAILED, completedBuild.getBuildResult().getBuildStatus());
    List<Object> executedCommands = buildAgentClientFactory.getBuildAgentClient().getExecutedCommands();
    logger.info("Executed commands {}.", executedCommands);
    Assert.assertEquals(2, executedCommands.size());
    Assertions.assertThat(executedCommands).anySatisfy(c -> ((String) c).contains("startSshd.sh"));
}
Also used : BuildExecutionSession(org.jboss.pnc.spi.executor.BuildExecutionSession) CompletedBuild(org.jboss.pnc.spi.builddriver.CompletedBuild) BuildDriverException(org.jboss.pnc.spi.builddriver.exception.BuildDriverException) RunningBuild(org.jboss.pnc.spi.builddriver.RunningBuild) LoggerFactory(org.slf4j.LoggerFactory) Assertions(org.assertj.core.api.Assertions) BuildExecutionConfiguration(org.jboss.pnc.spi.executor.BuildExecutionConfiguration) Mockito.doReturn(org.mockito.Mockito.doReturn) Logger(org.slf4j.Logger) TaskStatusUpdateEvent(org.jboss.pnc.buildagent.api.TaskStatusUpdateEvent) CompletedBuild(org.jboss.pnc.spi.builddriver.CompletedBuild) Test(org.junit.Test) BlockingQueue(java.util.concurrent.BlockingQueue) BuildStatus(org.jboss.pnc.enums.BuildStatus) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) ArrayBlockingQueue(java.util.concurrent.ArrayBlockingQueue) List(java.util.List) RunningEnvironment(org.jboss.pnc.spi.environment.RunningEnvironment) Paths(java.nio.file.Paths) DebugData(org.jboss.pnc.spi.builddriver.DebugData) Status(org.jboss.pnc.buildagent.api.Status) TermdBuildDriverModuleConfig(org.jboss.pnc.common.json.moduleconfig.TermdBuildDriverModuleConfig) SystemConfig(org.jboss.pnc.common.json.moduleconfig.SystemConfig) Assert(org.junit.Assert) BuildExecutionSession(org.jboss.pnc.spi.executor.BuildExecutionSession) Mockito.mock(org.mockito.Mockito.mock) BuildExecutionConfiguration(org.jboss.pnc.spi.executor.BuildExecutionConfiguration) DebugData(org.jboss.pnc.spi.builddriver.DebugData) RunningBuild(org.jboss.pnc.spi.builddriver.RunningBuild) RunningEnvironment(org.jboss.pnc.spi.environment.RunningEnvironment) TermdBuildDriverModuleConfig(org.jboss.pnc.common.json.moduleconfig.TermdBuildDriverModuleConfig) ArrayBlockingQueue(java.util.concurrent.ArrayBlockingQueue) Test(org.junit.Test)

Example 17 with BuildExecutionConfiguration

use of org.jboss.pnc.spi.executor.BuildExecutionConfiguration in project pnc by project-ncl.

the class TermdBuildDriverTest method shouldFetchFromGitAndBuild.

@Test(timeout = 15_000)
public void shouldFetchFromGitAndBuild() throws Throwable {
    // given
    Path tmpRepo = Files.createTempDirectory("tmpRepo");
    String repoPath = "file://" + tmpRepo.toAbsolutePath().toString() + "/test-repo";
    ZipUtils.unzipToDir(tmpRepo, "/repo.zip");
    String dirName = "test-repo-cloned";
    TermdBuildDriver driver = new TermdBuildDriver(systemConfig, buildDriverModuleConfig, clientFactory);
    BuildExecutionSession buildExecution = mock(BuildExecutionSession.class);
    BuildExecutionConfiguration buildExecutionConfiguration = mock(BuildExecutionConfiguration.class);
    doReturn(repoPath).when(buildExecutionConfiguration).getScmRepoURL();
    doReturn("master").when(buildExecutionConfiguration).getScmRevision();
    doReturn("mvn validate").when(buildExecutionConfiguration).getBuildScript();
    doReturn(dirName).when(buildExecutionConfiguration).getName();
    doReturn(buildExecutionConfiguration).when(buildExecution).getBuildExecutionConfiguration();
    doReturn(mock(RunningEnvironment.class)).when(buildExecution).getRunningEnvironment();
    AtomicReference<CompletedBuild> buildResult = new AtomicReference<>();
    CountDownLatch latch = new CountDownLatch(1);
    Consumer<CompletedBuild> onComplete = (completedBuild) -> {
        logger.info("Build completed.");
        buildResult.set(completedBuild);
        latch.countDown();
    };
    Consumer<Throwable> onError = (throwable) -> {
        logger.error("Error received: ", throwable);
        fail(throwable.getMessage());
    };
    // when
    RunningBuild runningBuild = driver.startProjectBuild(buildExecution, localEnvironmentPointer, onComplete, // TODO set monitor
    onError);
    // before the build
    // starts
    logger.info("Waiting for build to complete...");
    latch.await();
    // then
    assertThat(buildResult.get().getBuildResult()).isNotNull();
    assertThat(buildResult.get().getBuildResult().getBuildLog()).isNotEmpty();
    assertThat(Files.exists(localEnvironmentPointer.getWorkingDirectory())).isTrue();
    assertThat(Files.exists(localEnvironmentPointer.getWorkingDirectory().resolve(dirName))).isTrue();
}
Also used : Path(java.nio.file.Path) BuildExecutionSession(org.jboss.pnc.spi.executor.BuildExecutionSession) CompletedBuild(org.jboss.pnc.spi.builddriver.CompletedBuild) CANCELLED(org.jboss.pnc.enums.BuildStatus.CANCELLED) BuildDriverException(org.jboss.pnc.spi.builddriver.exception.BuildDriverException) RunningBuild(org.jboss.pnc.spi.builddriver.RunningBuild) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) LoggerFactory(org.slf4j.LoggerFactory) AtomicReference(java.util.concurrent.atomic.AtomicReference) ConfigurationParseException(org.jboss.pnc.common.json.ConfigurationParseException) Assert.fail(org.junit.Assert.fail) BuildExecutionConfiguration(org.jboss.pnc.spi.executor.BuildExecutionConfiguration) Path(java.nio.file.Path) Mockito.doReturn(org.mockito.Mockito.doReturn) Logger(org.slf4j.Logger) TaskStatusUpdateEvent(org.jboss.pnc.buildagent.api.TaskStatusUpdateEvent) Files(java.nio.file.Files) MethodHandles(java.lang.invoke.MethodHandles) CompletedBuild(org.jboss.pnc.spi.builddriver.CompletedBuild) Test(org.junit.Test) IOException(java.io.IOException) Consumer(java.util.function.Consumer) CountDownLatch(java.util.concurrent.CountDownLatch) RunningEnvironment(org.jboss.pnc.spi.environment.RunningEnvironment) Status(org.jboss.pnc.buildagent.api.Status) SystemConfig(org.jboss.pnc.common.json.moduleconfig.SystemConfig) BuildExecutionSession(org.jboss.pnc.spi.executor.BuildExecutionSession) Mockito.mock(org.mockito.Mockito.mock) BuildExecutionConfiguration(org.jboss.pnc.spi.executor.BuildExecutionConfiguration) RunningBuild(org.jboss.pnc.spi.builddriver.RunningBuild) AtomicReference(java.util.concurrent.atomic.AtomicReference) CountDownLatch(java.util.concurrent.CountDownLatch) RunningEnvironment(org.jboss.pnc.spi.environment.RunningEnvironment) Test(org.junit.Test)

Example 18 with BuildExecutionConfiguration

use of org.jboss.pnc.spi.executor.BuildExecutionConfiguration in project pnc by project-ncl.

the class TermdBuildDriverTest method shouldStartAndCancelWhileExecutingCommand.

@Test(timeout = 5_000)
public void shouldStartAndCancelWhileExecutingCommand() throws ConfigurationParseException, BuildDriverException, InterruptedException {
    // given
    String dirName = "test-workdir";
    String logStart = "Running the command...";
    String logEnd = "Command completed.";
    CountDownLatch latchCompleted = new CountDownLatch(1);
    ClientMockFactory mockFactory = new ClientMockFactory();
    TermdBuildDriver driver = new TermdBuildDriver(systemConfig, buildDriverModuleConfig, mockFactory);
    BuildExecutionSession buildExecution = mock(BuildExecutionSession.class);
    BuildExecutionConfiguration buildExecutionConfiguration = mock(BuildExecutionConfiguration.class);
    doReturn("echo \"" + logStart + "\"; mvn validate; echo \"" + logEnd + "\";").when(buildExecutionConfiguration).getBuildScript();
    doReturn(dirName).when(buildExecutionConfiguration).getName();
    doReturn(buildExecutionConfiguration).when(buildExecution).getBuildExecutionConfiguration();
    AtomicReference<CompletedBuild> buildResult = new AtomicReference<>();
    // when
    Consumer<CompletedBuild> onComplete = (completedBuild) -> {
        buildResult.set(completedBuild);
        latchCompleted.countDown();
    };
    Consumer<Throwable> onError = (throwable) -> {
        logger.error("Error received: ", throwable);
        fail(throwable.getMessage());
    };
    RunningBuild runningBuild = driver.startProjectBuild(buildExecution, localEnvironmentPointer, onComplete, onError);
    runningBuild.cancel();
    // simulate update for "CTRL+C" on a command, which results in the command failing
    mockFactory.getOnStatusUpdate().accept(TaskStatusUpdateEvent.newBuilder().newStatus(Status.FAILED).build());
    latchCompleted.await();
    // then
    assertThat(buildResult.get().getBuildResult()).isNotNull();
    assertThat(buildResult.get().getBuildResult().getBuildStatus()).isEqualTo(CANCELLED);
}
Also used : BuildExecutionSession(org.jboss.pnc.spi.executor.BuildExecutionSession) CompletedBuild(org.jboss.pnc.spi.builddriver.CompletedBuild) CANCELLED(org.jboss.pnc.enums.BuildStatus.CANCELLED) BuildDriverException(org.jboss.pnc.spi.builddriver.exception.BuildDriverException) RunningBuild(org.jboss.pnc.spi.builddriver.RunningBuild) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) LoggerFactory(org.slf4j.LoggerFactory) AtomicReference(java.util.concurrent.atomic.AtomicReference) ConfigurationParseException(org.jboss.pnc.common.json.ConfigurationParseException) Assert.fail(org.junit.Assert.fail) BuildExecutionConfiguration(org.jboss.pnc.spi.executor.BuildExecutionConfiguration) Path(java.nio.file.Path) Mockito.doReturn(org.mockito.Mockito.doReturn) Logger(org.slf4j.Logger) TaskStatusUpdateEvent(org.jboss.pnc.buildagent.api.TaskStatusUpdateEvent) Files(java.nio.file.Files) MethodHandles(java.lang.invoke.MethodHandles) CompletedBuild(org.jboss.pnc.spi.builddriver.CompletedBuild) Test(org.junit.Test) IOException(java.io.IOException) Consumer(java.util.function.Consumer) CountDownLatch(java.util.concurrent.CountDownLatch) RunningEnvironment(org.jboss.pnc.spi.environment.RunningEnvironment) Status(org.jboss.pnc.buildagent.api.Status) SystemConfig(org.jboss.pnc.common.json.moduleconfig.SystemConfig) BuildExecutionSession(org.jboss.pnc.spi.executor.BuildExecutionSession) Mockito.mock(org.mockito.Mockito.mock) BuildExecutionConfiguration(org.jboss.pnc.spi.executor.BuildExecutionConfiguration) RunningBuild(org.jboss.pnc.spi.builddriver.RunningBuild) AtomicReference(java.util.concurrent.atomic.AtomicReference) CountDownLatch(java.util.concurrent.CountDownLatch) Test(org.junit.Test)

Example 19 with BuildExecutionConfiguration

use of org.jboss.pnc.spi.executor.BuildExecutionConfiguration in project pnc by project-ncl.

the class DatastoreAdapter method storeResult.

public BuildRecord storeResult(BuildTask buildTask, BuildResult buildResult) throws DatastoreException {
    try {
        BuildStatus buildRecordStatus = NEW;
        BuildRecord.Builder buildRecordBuilder = initBuildRecordBuilder(buildTask);
        buildRecordBuilder.buildContentId(buildTask.getContentId());
        if (buildResult.getRepourResult().isPresent()) {
            RepourResult repourResult = buildResult.getRepourResult().get();
            buildRecordBuilder.repourLog(repourResult.getLog());
            buildRecordBuilder.executionRootName(repourResult.getExecutionRootName());
            buildRecordBuilder.executionRootVersion(repourResult.getExecutionRootVersion());
            CompletionStatus repourCompletionStatus = repourResult.getCompletionStatus();
            if (repourCompletionStatus != null) {
                switch(repourCompletionStatus) {
                    case SUCCESS:
                    case NO_REBUILD_REQUIRED:
                        break;
                    case FAILED:
                        buildRecordBuilder.appendLog("\nBuild failed during the alignment phase, please check the 'Alignment Log' tab for more information.\n");
                        buildRecordStatus = FAILED;
                        break;
                    case CANCELLED:
                        buildRecordBuilder.appendLog("\nBuild cancelled during alignment phase.\n");
                        buildRecordStatus = CANCELLED;
                        break;
                    case TIMED_OUT:
                        buildRecordBuilder.appendLog("\nBuild timed-out during alignment phase.\n");
                        buildRecordStatus = SYSTEM_ERROR;
                        break;
                    case SYSTEM_ERROR:
                        buildRecordBuilder.appendLog("\nBuild failed with SYSTEM_ERROR during the alignment phase, " + "please check the 'Alignment Log' tab for more information.\n");
                        buildRecordStatus = SYSTEM_ERROR;
                        break;
                    default:
                        buildRecordBuilder.appendLog("\nInvalid status during the alignment phase, failing with SYSTEM_ERROR.\n");
                        buildRecordStatus = SYSTEM_ERROR;
                        break;
                }
            }
        } else {
            userLog.warn("Missing Repour Result!");
            log.warn("[BuildTask:" + buildTask.getId() + "] Missing RepourResult.");
        }
        if (buildResult.getBuildDriverResult().isPresent()) {
            BuildDriverResult buildDriverResult = buildResult.getBuildDriverResult().get();
            buildRecordBuilder.appendLog(buildDriverResult.getBuildLog());
            buildDriverResult.getOutputChecksum().ifPresent(buildRecordBuilder::buildOutputChecksum);
            // TODO buildRecord should use CompletionStatus
            buildRecordStatus = buildDriverResult.getBuildStatus();
        } else if (!buildResult.hasFailed()) {
            return storeResult(buildTask, Optional.of(buildResult), new BuildCoordinationException("Trying to store success build with incomplete result. Missing BuildDriverResult."));
        }
        if (buildResult.getEnvironmentDriverResult().isPresent()) {
            EnvironmentDriverResult environmentDriverResult = buildResult.getEnvironmentDriverResult().get();
            buildRecordBuilder.appendLog(environmentDriverResult.getLog());
            environmentDriverResult.getSshCredentials().ifPresent(c -> {
                buildRecordBuilder.sshCommand(c.getCommand());
                buildRecordBuilder.sshPassword(c.getPassword());
            });
            if (environmentDriverResult.getCompletionStatus() != null) {
                switch(environmentDriverResult.getCompletionStatus()) {
                    case SUCCESS:
                    case NO_REBUILD_REQUIRED:
                        break;
                    case FAILED:
                        buildRecordStatus = FAILED;
                        break;
                    case CANCELLED:
                        buildRecordStatus = CANCELLED;
                        break;
                    case TIMED_OUT:
                    case SYSTEM_ERROR:
                        buildRecordStatus = SYSTEM_ERROR;
                        break;
                    default:
                        buildRecordBuilder.appendLog("\nInvalid status during the environment setup phase, failing with SYSTEM_ERROR.\n");
                        buildRecordStatus = SYSTEM_ERROR;
                        break;
                }
            }
        }
        List<Artifact> builtArtifacts = Collections.emptyList();
        List<Artifact> dependencies = Collections.emptyList();
        if (buildResult.getRepositoryManagerResult().isPresent()) {
            RepositoryManagerResult repositoryManagerResult = buildResult.getRepositoryManagerResult().get();
            buildRecordBuilder.appendLog(repositoryManagerResult.getLog());
            if (repositoryManagerResult.getCompletionStatus() != null) {
                switch(// TODO, do not mix statuses
                repositoryManagerResult.getCompletionStatus()) {
                    case SUCCESS:
                    case NO_REBUILD_REQUIRED:
                        break;
                    case FAILED:
                        buildRecordStatus = FAILED;
                        break;
                    case CANCELLED:
                        buildRecordStatus = CANCELLED;
                        break;
                    case TIMED_OUT:
                    case SYSTEM_ERROR:
                        buildRecordStatus = SYSTEM_ERROR;
                        break;
                    default:
                        buildRecordBuilder.appendLog("\nInvalid status during the promotion phase, failing with SYSTEM_ERROR.\n");
                        buildRecordStatus = SYSTEM_ERROR;
                        break;
                }
            }
            builtArtifacts = repositoryManagerResult.getBuiltArtifacts();
            Map<Artifact, String> builtConflicts = datastore.checkForBuiltArtifacts(builtArtifacts);
            if (builtConflicts.size() > 0) {
                return storeResult(buildTask, Optional.of(buildResult), new BuildCoordinationException("Trying to store success build with invalid repository manager result. Conflicting artifact data found: " + builtConflicts.toString()));
            }
            dependencies = repositoryManagerResult.getDependencies();
        } else if (!buildResult.hasFailed()) {
            return storeResult(buildTask, Optional.of(buildResult), new BuildCoordinationException("Trying to store success build with incomplete result. Missing RepositoryManagerResult."));
        }
        if (NEW.equals(buildRecordStatus)) {
            switch(buildResult.getCompletionStatus()) {
                case SUCCESS:
                case NO_REBUILD_REQUIRED:
                case FAILED:
                case SYSTEM_ERROR:
                    break;
                case CANCELLED:
                    buildRecordStatus = CANCELLED;
                    break;
                case TIMED_OUT:
                    buildRecordStatus = SYSTEM_ERROR;
                    buildRecordBuilder.appendLog("-- Operation TIMED-OUT --");
                    userLog.warn("Operation TIMED-OUT.");
                    break;
                default:
                    buildRecordBuilder.appendLog("\nInvalid status detected in the final completion status, failing with SYSTEM_ERROR.\n");
                    break;
            }
        }
        log.debug("Setting status " + buildRecordStatus.toString() + " to buildRecord.");
        buildRecordBuilder.status(buildRecordStatus);
        if (buildResult.getBuildExecutionConfiguration().isPresent()) {
            BuildExecutionConfiguration buildExecutionConfig = buildResult.getBuildExecutionConfiguration().get();
            buildRecordBuilder.scmRepoURL(buildExecutionConfig.getScmRepoURL());
            buildRecordBuilder.scmRevision(buildExecutionConfig.getScmRevision());
            buildRecordBuilder.scmTag(buildExecutionConfig.getScmTag());
        } else if (!buildResult.hasFailed()) {
            return storeResult(buildTask, Optional.of(buildResult), new BuildCoordinationException("Trying to store success build with incomplete result. Missing BuildExecutionConfiguration."));
        }
        log.debug("Storing results of buildTask [{}] to datastore.", buildTask.getId());
        userLog.info("Successfully completed.");
        return datastore.storeCompletedBuild(buildRecordBuilder, builtArtifacts, dependencies);
    } catch (Exception e) {
        return storeResult(buildTask, Optional.of(buildResult), e);
    }
}
Also used : BuildExecutionConfiguration(org.jboss.pnc.spi.executor.BuildExecutionConfiguration) BuildDriverResult(org.jboss.pnc.spi.builddriver.BuildDriverResult) RepositoryManagerResult(org.jboss.pnc.spi.repositorymanager.RepositoryManagerResult) BuildRecord(org.jboss.pnc.model.BuildRecord) BuildCoordinationException(org.jboss.pnc.coordinator.BuildCoordinationException) Artifact(org.jboss.pnc.model.Artifact) BuildCoordinationException(org.jboss.pnc.coordinator.BuildCoordinationException) DatastoreException(org.jboss.pnc.spi.datastore.DatastoreException) EnvironmentDriverResult(org.jboss.pnc.spi.environment.EnvironmentDriverResult) CompletionStatus(org.jboss.pnc.spi.coordinator.CompletionStatus) BuildStatus(org.jboss.pnc.enums.BuildStatus) RepourResult(org.jboss.pnc.spi.repour.RepourResult)

Example 20 with BuildExecutionConfiguration

use of org.jboss.pnc.spi.executor.BuildExecutionConfiguration in project pnc by project-ncl.

the class BpmBuildTask method getBuildExecutionConfiguration.

private BuildExecutionConfigurationRest getBuildExecutionConfiguration(BuildTask buildTask) {
    BuildConfigurationAudited buildConfigurationAudited = buildTask.getBuildConfigurationAudited();
    String contentId = ContentIdentityManager.getBuildContentId(buildTask.getId());
    BuildExecutionConfiguration buildExecutionConfiguration = BuildExecutionConfiguration.build(buildTask.getId(), contentId, buildTask.getUser().getId().toString(), buildConfigurationAudited.getBuildScript(), buildConfigurationAudited.getId().toString(), buildConfigurationAudited.getName(), // TODO update to use also other parts or Repository Configuration
    buildConfigurationAudited.getRepositoryConfiguration().getInternalUrl(), buildConfigurationAudited.getScmRevision(), // SCM Tag is about to be set once it is created after the alignment phase
    null, buildConfigurationAudited.getRepositoryConfiguration().getExternalUrl(), buildConfigurationAudited.getRepositoryConfiguration().isPreBuildSyncEnabled(), buildConfigurationAudited.getBuildEnvironment().getSystemImageId(), buildConfigurationAudited.getBuildEnvironment().getSystemImageRepositoryUrl(), buildConfigurationAudited.getBuildEnvironment().getSystemImageType(), buildConfigurationAudited.getBuildConfiguration().getBuildType(), buildTask.getBuildOptions().isKeepPodOnFailure(), buildConfigurationAudited.getGenericParameters(), buildTask.getBuildOptions().isTemporaryBuild(), TimeUtils.generateTimestamp(buildTask.getBuildOptions().isTimestampAlignment(), buildTask.getBuildSetTask().getStartTime()), buildConfigurationAudited.isBrewPullActive(), buildConfigurationAudited.getDefaultAlignmentParams(), buildTask.getBuildOptions().getAlignmentPreference());
    return new BuildExecutionConfigurationRest(buildExecutionConfiguration);
}
Also used : BuildConfigurationAudited(org.jboss.pnc.model.BuildConfigurationAudited) BuildExecutionConfiguration(org.jboss.pnc.spi.executor.BuildExecutionConfiguration) ToString(lombok.ToString) BuildExecutionConfigurationRest(org.jboss.pnc.bpm.model.BuildExecutionConfigurationRest)

Aggregations

BuildExecutionConfiguration (org.jboss.pnc.spi.executor.BuildExecutionConfiguration)24 Consumer (java.util.function.Consumer)11 Logger (org.slf4j.Logger)11 LoggerFactory (org.slf4j.LoggerFactory)11 Test (org.junit.Test)10 BuildExecutionSession (org.jboss.pnc.spi.executor.BuildExecutionSession)9 SystemConfig (org.jboss.pnc.common.json.moduleconfig.SystemConfig)7 BuildResult (org.jboss.pnc.spi.BuildResult)7 ExecutorException (org.jboss.pnc.spi.executor.exceptions.ExecutorException)7 RepositoryManagerResult (org.jboss.pnc.spi.repositorymanager.RepositoryManagerResult)7 ConfigurationParseException (org.jboss.pnc.common.json.ConfigurationParseException)6 BuildDriverResult (org.jboss.pnc.spi.builddriver.BuildDriverResult)6 CompletedBuild (org.jboss.pnc.spi.builddriver.CompletedBuild)6 RunningBuild (org.jboss.pnc.spi.builddriver.RunningBuild)6 RunningEnvironment (org.jboss.pnc.spi.environment.RunningEnvironment)6 IOException (java.io.IOException)5 BuildExecutionStatusChangedEvent (org.jboss.pnc.spi.events.BuildExecutionStatusChangedEvent)5 Inject (javax.inject.Inject)4 TaskStatusUpdateEvent (org.jboss.pnc.buildagent.api.TaskStatusUpdateEvent)4 BuildExecutionStatus (org.jboss.pnc.enums.BuildExecutionStatus)4