use of org.eclipse.jkube.kit.enricher.api.DefaultEnricherManager in project jkube by eclipse.
the class ResourceMojo method generateResources.
private KubernetesList generateResources() throws IOException {
JKubeEnricherContext.JKubeEnricherContextBuilder ctxBuilder = JKubeEnricherContext.builder().project(javaProject).processorConfig(extractEnricherConfig()).settings(MavenUtil.getRegistryServerFromMavenSettings(settings)).resources(resources).images(resolvedImages).log(log);
DefaultEnricherManager enricherManager = new DefaultEnricherManager(ctxBuilder.build(), useProjectClasspath ? javaProject.getCompileClassPathElements() : Collections.emptyList());
return jkubeServiceHub.getResourceService().generateResources(getPlatformMode(), enricherManager, log);
}
use of org.eclipse.jkube.kit.enricher.api.DefaultEnricherManager in project jkube by eclipse.
the class AbstractJKubeTask method init.
private void init() {
kubernetesExtension.javaProject = GradleUtil.convertGradleProject(getProject());
kitLogger = createLogger(null);
logOutputSpecFactory = new LogOutputSpecFactory(isAnsiEnabled(), kubernetesExtension.getLogStdoutOrDefault(), kubernetesExtension.getLogDateOrNull());
clusterAccess = new ClusterAccess(kitLogger, initClusterConfiguration());
jKubeServiceHub = initJKubeServiceHubBuilder().build();
kubernetesExtension.resources = updateResourceConfigNamespace(kubernetesExtension.getNamespaceOrNull(), kubernetesExtension.resources);
ImageConfigResolver imageConfigResolver = new ImageConfigResolver();
try {
resolvedImages = resolveImages(imageConfigResolver);
enricherManager = new DefaultEnricherManager(JKubeEnricherContext.builder().project(kubernetesExtension.javaProject).processorConfig(ProfileUtil.blendProfileWithConfiguration(ProfileUtil.ENRICHER_CONFIG, kubernetesExtension.getProfileOrNull(), resolveResourceSourceDirectory(), kubernetesExtension.enricher)).images(resolvedImages).resources(kubernetesExtension.resources).log(kitLogger).build());
} catch (IOException exception) {
kitLogger.error("Error in fetching Build timestamps: " + exception.getMessage());
}
}
use of org.eclipse.jkube.kit.enricher.api.DefaultEnricherManager in project jkube by eclipse.
the class AbstractDockerMojo method buildServiceConfigBuilder.
protected BuildServiceConfig.BuildServiceConfigBuilder buildServiceConfigBuilder() {
return BuildServiceConfig.builder().buildRecreateMode(BuildRecreateMode.fromParameter(buildRecreate)).jKubeBuildStrategy(getJKubeBuildStrategy()).forcePull(forcePull).imagePullManager(ImagePullManager.createImagePullManager(imagePullPolicy, autoPull, project.getProperties())).buildDirectory(project.getBuild().getDirectory()).resourceConfig(resources).resourceDir(resourceDir).attacher((classifier, destFile) -> {
if (destFile.exists()) {
projectHelper.attachArtifact(project, "yml", classifier, destFile);
}
}).enricherTask(builder -> {
DefaultEnricherManager enricherManager = new DefaultEnricherManager(getEnricherContext(), useProjectClasspath ? javaProject.getCompileClassPathElements() : Collections.emptyList());
enricherManager.enrich(PlatformMode.kubernetes, builder);
enricherManager.enrich(PlatformMode.openshift, builder);
});
}
Aggregations