use of org.jboss.pnc.dto.BuildConfigurationRevisionRef in project pnc by project-ncl.
the class BuildStatusMQNotifications method prepareHeaders.
private Map<String, String> prepareHeaders(BuildStatusChangedEvent event) {
BuildConfigurationRevisionRef buildConfigurationAudited = event.getBuild().getBuildConfigRevision();
Map<String, String> headers = new HashMap<>();
headers.put("type", "BuildStateChange");
headers.put("attribute", "state-change");
headers.put("name", buildConfigurationAudited.getName());
headers.put("configurationId", buildConfigurationAudited.getId());
headers.put("configurationRevision", buildConfigurationAudited.getRev().toString());
headers.put("oldStatus", toStringStatus(event.getOldStatus()));
headers.put("newStatus", toStringStatus(event.getNewStatus()));
return headers;
}
use of org.jboss.pnc.dto.BuildConfigurationRevisionRef in project pnc by project-ncl.
the class BuildTriggererImpl method doTriggerGroupBuild.
private BuildSetTask doTriggerGroupBuild(final int groupConfigId, Optional<GroupBuildRequest> revs, BuildOptions buildOptions) throws CoreException {
final BuildConfigurationSet buildConfigurationSet = buildConfigurationSetRepository.queryById(groupConfigId);
Preconditions.checkArgument(buildConfigurationSet != null, "Can't find configuration with given id=" + groupConfigId);
List<BuildConfigurationRevisionRef> revisions = revs.map(GroupBuildRequest::getBuildConfigurationRevisions).orElse(Collections.emptyList());
BuildSetTask buildSetTask = buildCoordinator.build(hibernateLazyInitializer.initializeBuildConfigurationSetBeforeTriggeringIt(buildConfigurationSet), loadAuditedsFromDB(buildConfigurationSet, revisions), user.currentUser(), buildOptions);
logger.info("Started build of Group Configuration {}. Build Tasks: {}", groupConfigId, buildSetTask.getBuildTasks().stream().map(BuildTask::getId).collect(Collectors.joining()));
return buildSetTask;
}
Aggregations