use of org.jboss.pnc.model.BuildConfigurationAudited in project pnc by project-ncl.
the class RepositoryManagerDriver method collectRepoManagerResult.
@Override
public RepositoryManagerResult collectRepoManagerResult(String id) throws RepositoryManagerException {
Base32LongID buildId = new Base32LongID(id);
BuildRecord br = buildRecordRepository.findByIdFetchProperties(buildId);
if (br == null) {
return null;
}
BuildConfigurationAudited bc = br.getBuildConfigurationAudited();
String buildContentId = br.getBuildContentId();
BuildType buildType = bc.getBuildType();
boolean tempBuild = br.isTemporaryBuild();
Indy indy = init(null);
String buildPromotionTarget = tempBuild ? TEMP_BUILD_PROMOTION_TARGET : BUILD_PROMOTION_TARGET;
String packageType = getIndyPackageTypeKey(buildType.getRepoType());
BuildCategory buildCategory = getBuildCategory(bc.getGenericParameters());
ArtifactFilter artifactFilter = new ArtifactFilterImpl(ignoredPathPatternsPromotion, ignoredPathPatternsData, ignoredRepoPatterns);
IndyRepositorySession session = new IndyRepositorySession(indy, indy, buildContentId, packageType, null, artifactFilter, buildPromotionTarget, buildCategory, tempBuild);
return session.extractBuildArtifacts(false);
}
use of org.jboss.pnc.model.BuildConfigurationAudited in project pnc by project-ncl.
the class DatastoreAdapter method getLatestBuildConfigurationAuditedInitializeBCDependencies.
/**
* Get the latest audited version of the given build configuration and fetch whole dependency tree of the related BC
*
* @param buildConfigurationId The id of the config to check
* @return The latest audited version of the build configuration with fetched dependency tree of the related BC
*/
public BuildConfigurationAudited getLatestBuildConfigurationAuditedInitializeBCDependencies(Integer buildConfigurationId) {
BuildConfigurationAudited buildConfigAudited = datastore.getLatestBuildConfigurationAuditedLoadBCDependencies(buildConfigurationId);
loadBuildConfigurations(buildConfigAudited);
return buildConfigAudited;
}
use of org.jboss.pnc.model.BuildConfigurationAudited in project pnc by project-ncl.
the class DatastoreAdapter method getLatestBuildConfigurationAudited.
/**
* Get the latest audited revision for the given build configuration ID
*
* @param buildConfigurationId Build Configuration ID
* @return The latest revision of the given build configuration
*/
public BuildConfigurationAudited getLatestBuildConfigurationAudited(Integer buildConfigurationId) {
BuildConfigurationAudited buildConfigAudited = datastore.getLatestBuildConfigurationAudited(buildConfigurationId);
loadBuildConfigurations(buildConfigAudited);
return buildConfigAudited;
}
use of org.jboss.pnc.model.BuildConfigurationAudited in project pnc by project-ncl.
the class DefaultBuildCoordinatorTest method testBuildBuildConfigurationSet.
@Test
public void testBuildBuildConfigurationSet() throws BuildConflictException, CoreException, DatastoreException {
BuildConfigurationAudited bca = mockDatastoreWithBCAudited(BC_1, 5);
BuildConfigurationAudited bcaDep = mockDatastoreWithBCAudited(BC_2, 2);
BuildConfigurationAudited bca3 = mockDatastoreWithBCAudited(BC_3, 9);
when(datastore.getBuildConfigurations(BCS)).thenReturn(BCS.getBuildConfigurations());
BuildSetTask buildSetTask = coordinator.build(BCS, USER, BUILD_OPTIONS);
assertEquals(2, buildSetTask.getBuildTasks().size());
assertNotNull(buildSetTask.getBuildTask(bca));
// Dependencies outside group are not build
assertNull(buildSetTask.getBuildTask(bcaDep));
assertNotNull(buildSetTask.getBuildTask(bca3));
assertSame(BUILD_OPTIONS, buildSetTask.getBuildOptions());
}
use of org.jboss.pnc.model.BuildConfigurationAudited in project pnc by project-ncl.
the class DefaultBuildCoordinatorTest method toBuildConfigurationAudited.
private BuildConfigurationAudited toBuildConfigurationAudited(BuildConfiguration bc, int rev) {
BuildConfigurationAudited bca = BuildConfigurationAudited.fromBuildConfiguration(bc, rev);
bca.setRev(rev);
return bca;
}
Aggregations