use of org.jboss.pnc.bacon.pig.impl.pnc.PncBuild in project bacon by project-ncl.
the class ExtraDeliverableDownloader method downloadArtifacts.
private void downloadArtifacts(String buildName, List<Map<String, String>> artifacts) {
PncBuild build = builds.get(buildName);
artifacts.forEach(artifact -> downloadArtifact(build, artifact.get("matching"), artifact.get("suffix")));
}
use of org.jboss.pnc.bacon.pig.impl.pnc.PncBuild in project bacon by project-ncl.
the class MicroProfileSmallRyeCommunityDepAnalyzer method trigger.
@Override
public void trigger() {
log.info("Running MicroProfileSmallRyeCommunityDepAnalyzer");
Set<GAV> allGavs = new HashSet<>();
for (PncBuild build : builds.values()) {
Set<GAV> gavs = new BuildLogWithDependencyTrees(build.getBuildLog()).communityGavsForModules.entrySet().stream().filter(e -> !e.getKey().contains("test") && !e.getKey().contains("tck")).flatMap(e -> e.getValue().stream()).collect(Collectors.toSet());
Path targetPath = Paths.get(extrasPath, "community-dependencies-" + build.getName() + ".csv");
new CommunityDepAnalyzer(gavs).generateAnalysis(targetPath.toAbsolutePath().toString());
allGavs.addAll(gavs);
}
Path targetPath = Paths.get(extrasPath, "community-dependencies.csv");
new CommunityDepAnalyzer(allGavs).generateAnalysis(targetPath.toAbsolutePath().toString());
}
use of org.jboss.pnc.bacon.pig.impl.pnc.PncBuild in project bacon by project-ncl.
the class PigFacade method pushToBrew.
private static void pushToBrew(boolean reimport) {
abortIfBuildDataAbsentFromContext();
Map<String, PncBuild> builds = PigContext.get().getBuilds();
String tagPrefix = getBrewTag(context().getPncImportResult().getVersion());
List<PncBuild> buildsToPush = getBuildsToPush(builds);
if (log.isInfoEnabled()) {
log.info("Pushing the following builds to brew: {}", buildsToPush.stream().map(PncBuild::getId).collect(Collectors.toList()));
}
for (PncBuild build : buildsToPush) {
BuildPushParameters request = BuildPushParameters.builder().tagPrefix(tagPrefix).reimport(reimport).build();
// TODO: customize the timeout
try (AdvancedBuildClient pushingClient = new AdvancedBuildClient(PncClientHelper.getPncConfiguration())) {
BuildPushResult pushResult = pushingClient.executeBrewPush(build.getId(), request, 15L, TimeUnit.MINUTES);
if (pushResult.getStatus() != BuildPushStatus.SUCCESS) {
throw new RuntimeException("Failed to push build " + build.getId() + " to brew. Push result: " + pushResult);
}
log.info("{} pushed to brew ( {} ) ", build.getId(), UrlGenerator.generateBuildUrl(build.getId()));
} catch (RemoteResourceException e) {
throw new RuntimeException("Failed to push build " + build.getId() + " to brew (" + UrlGenerator.generateBuildUrl(build.getId()) + ")", e);
}
}
}
use of org.jboss.pnc.bacon.pig.impl.pnc.PncBuild in project bacon by project-ncl.
the class JavadocManager method addImportBOM.
private boolean addImportBOM(Profile profile) {
Dependency dep;
PncBuild build = getBuild(generationData.getImportBom());
if (build != null) {
List<ArtifactWrapper> artifacts = build.getBuiltArtifacts();
if (artifacts != null && !artifacts.isEmpty()) {
GAV tmp = artifacts.get(0).toGAV();
// Get the first artifact and create the dep on the pom
dep = new Dependency();
dep.setArtifactId(tmp.getArtifactId());
dep.setGroupId(tmp.getGroupId());
dep.setVersion(tmp.getVersion());
dep.setType("pom");
dep.setScope("import");
profile.getDependencyManagement().addDependency(dep);
} else {
log.error("Error no artifacts in build for 'importBom' {}", generationData.getImportBom());
return false;
}
} else {
log.error("Error no build found for 'importBom' {}", generationData.getImportBom());
return false;
}
return true;
}
use of org.jboss.pnc.bacon.pig.impl.pnc.PncBuild in project bacon by project-ncl.
the class OfflineManifestGenerator method sourceBuilds.
private Collection<PncBuild> sourceBuilds() {
RepoGenerationData generationData = pigConfiguration.getFlow().getRepositoryGeneration();
RepoGenerationStrategy strategy = generationData.getStrategy();
if (!Arrays.asList(IGNORE, BUILD_GROUP).contains(strategy)) {
return builds.values();
}
List<String> excludeSourceBuilds = generationData.getExcludeSourceBuilds();
return builds.values().stream().filter(build -> !excludeSourceBuilds.contains(build.getName())).collect(Collectors.toList());
}
Aggregations