use of org.jboss.pnc.model.IdRev in project pnc by project-ncl.
the class ArtifactProviderImpl method getRevision.
@Override
public ArtifactRevision getRevision(String id, Integer rev) {
IdRev idRev = new IdRev(Integer.valueOf(id), rev);
ArtifactAudited auditedArtifact = artifactAuditedRepository.queryById(idRev);
return artifactRevisionMapper.toDTO(auditedArtifact);
}
use of org.jboss.pnc.model.IdRev in project pnc by project-ncl.
the class BuildConfigurationProviderImpl method getRevision.
@Override
public BuildConfigurationRevision getRevision(String id, Integer rev) {
IdRev idRev = new IdRev(Integer.valueOf(id), rev);
BuildConfigurationAudited auditedBuildConfig = buildConfigurationAuditedRepository.queryById(idRev);
return buildConfigurationRevisionMapper.toDTO(auditedBuildConfig);
}
use of org.jboss.pnc.model.IdRev in project pnc by project-ncl.
the class BuildTriggererImpl method doTriggerBuild.
private BuildSetTask doTriggerBuild(final int buildConfigId, OptionalInt buildConfigurationRevision, BuildOptions buildOptions) throws BuildConflictException, CoreException {
BuildSetTask buildSetTask;
if (buildConfigurationRevision.isPresent()) {
final BuildConfigurationAudited buildConfigurationAudited = buildConfigurationAuditedRepository.queryById(new IdRev(buildConfigId, buildConfigurationRevision.getAsInt()));
Preconditions.checkArgument(buildConfigurationAudited != null, "Can't find Build Configuration with id=" + buildConfigId + ", rev=" + buildConfigurationRevision.getAsInt());
buildSetTask = buildCoordinator.build(hibernateLazyInitializer.initializeBuildConfigurationAuditedBeforeTriggeringIt(buildConfigurationAudited), user.currentUser(), buildOptions);
} else {
final BuildConfiguration buildConfiguration = buildConfigurationRepository.queryById(buildConfigId);
Preconditions.checkArgument(buildConfiguration != null, "Can't find Build Configuration with id=" + buildConfigId);
buildSetTask = buildCoordinator.build(hibernateLazyInitializer.initializeBuildConfigurationBeforeTriggeringIt(buildConfiguration), user.currentUser(), buildOptions);
}
logger.info("Started build of Build Configuration {}. Build Tasks: {}", buildConfigId, buildSetTask.getBuildTasks().stream().map(BuildTask::getId).collect(Collectors.joining()));
return buildSetTask;
}
Aggregations