Search in sources :

Example 1 with ImagePullManager

use of org.eclipse.jkube.kit.build.service.docker.ImagePullManager 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);
    });
}
Also used : ResourceUtil(org.eclipse.jkube.kit.common.util.ResourceUtil) ProcessorConfig(org.eclipse.jkube.kit.config.resource.ProcessorConfig) BuildServiceConfig(org.eclipse.jkube.kit.config.service.BuildServiceConfig) Ansi(org.fusesource.jansi.Ansi) ProfileUtil(org.eclipse.jkube.kit.profile.ProfileUtil) Enumeration(java.util.Enumeration) URL(java.net.URL) DEFAULT_MAX_CONNECTIONS(org.eclipse.jkube.kit.build.service.docker.DockerAccessFactory.DockerAccessContext.DEFAULT_MAX_CONNECTIONS) ImageConfiguration(org.eclipse.jkube.kit.config.image.ImageConfiguration) Parameter(org.apache.maven.plugins.annotations.Parameter) KitLoggerProvider(org.eclipse.jkube.maven.plugin.mojo.KitLoggerProvider) ImageConfigResolver(org.eclipse.jkube.kit.build.service.docker.config.handler.ImageConfigResolver) Settings(org.apache.maven.settings.Settings) DockerMachineConfiguration(org.eclipse.jkube.kit.build.service.docker.config.DockerMachineConfiguration) MavenProject(org.apache.maven.project.MavenProject) AnsiLogger(org.eclipse.jkube.kit.common.util.AnsiLogger) EnvUtil(org.eclipse.jkube.kit.common.util.EnvUtil) Map(java.util.Map) ConfigHelper(org.eclipse.jkube.kit.build.service.docker.helper.ConfigHelper) Method(java.lang.reflect.Method) WatchMode(org.eclipse.jkube.kit.config.image.WatchMode) BuildRecreateMode(org.eclipse.jkube.kit.config.resource.BuildRecreateMode) RegistryConfig(org.eclipse.jkube.kit.common.RegistryConfig) RuntimeMode(org.eclipse.jkube.kit.config.resource.RuntimeMode) MojoExecution(org.apache.maven.plugin.MojoExecution) ImagePullManager(org.eclipse.jkube.kit.build.service.docker.ImagePullManager) JKubeEnricherContext(org.eclipse.jkube.kit.enricher.api.JKubeEnricherContext) LineNumberReader(java.io.LineNumberReader) ContainerNamingUtil(org.eclipse.jkube.kit.build.service.docker.helper.ContainerNamingUtil) StandardCharsets(java.nio.charset.StandardCharsets) InvocationTargetException(java.lang.reflect.InvocationTargetException) MessageUtils(org.apache.maven.shared.utils.logging.MessageUtils) DockerServiceHub(org.eclipse.jkube.kit.build.service.docker.DockerServiceHub) List(java.util.List) JKubeServiceHub(org.eclipse.jkube.kit.config.service.JKubeServiceHub) Optional(java.util.Optional) LogOutputSpecFactory(org.eclipse.jkube.kit.build.service.docker.access.log.LogOutputSpecFactory) ClusterConfiguration(org.eclipse.jkube.kit.config.access.ClusterConfiguration) DockerAccess(org.eclipse.jkube.kit.build.service.docker.access.DockerAccess) DependencyResolutionRequiredException(org.apache.maven.artifact.DependencyResolutionRequiredException) Context(org.codehaus.plexus.context.Context) AbstractMojo(org.apache.maven.plugin.AbstractMojo) JKubeBuildStrategy(org.eclipse.jkube.kit.config.image.build.JKubeBuildStrategy) ClusterAccess(org.eclipse.jkube.kit.config.access.ClusterAccess) MavenProjectHelper(org.apache.maven.project.MavenProjectHelper) GeneratorManager(org.eclipse.jkube.generator.api.GeneratorManager) SecDispatcher(org.sonatype.plexus.components.sec.dispatcher.SecDispatcher) BuildReferenceDateUtil.getBuildTimestamp(org.eclipse.jkube.kit.common.util.BuildReferenceDateUtil.getBuildTimestamp) LogDispatcher(org.eclipse.jkube.kit.build.service.docker.access.log.LogDispatcher) Component(org.apache.maven.plugins.annotations.Component) ComponentLookupException(org.codehaus.plexus.component.repository.exception.ComponentLookupException) RegistryAuthConfiguration(org.eclipse.jkube.kit.config.image.build.RegistryAuthConfiguration) GeneratorContext(org.eclipse.jkube.generator.api.GeneratorContext) PlatformMode(org.eclipse.jkube.kit.config.resource.PlatformMode) GavLabel(org.eclipse.jkube.kit.build.core.GavLabel) PlexusConstants(org.codehaus.plexus.PlexusConstants) JKubeConfiguration(org.eclipse.jkube.kit.common.JKubeConfiguration) AuthConfigFactory(org.eclipse.jkube.kit.build.service.docker.auth.AuthConfigFactory) ResourceConfig(org.eclipse.jkube.kit.config.resource.ResourceConfig) Contextualizable(org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable) ContextException(org.codehaus.plexus.context.ContextException) DEFAULT_LOG_PREFIX(org.eclipse.jkube.maven.plugin.mojo.build.AbstractJKubeMojo.DEFAULT_LOG_PREFIX) JavaProject(org.eclipse.jkube.kit.common.JavaProject) MavenSession(org.apache.maven.execution.MavenSession) DockerAccessFactory(org.eclipse.jkube.kit.build.service.docker.DockerAccessFactory) MavenUtil(org.eclipse.jkube.kit.common.util.MavenUtil) KubernetesClientUtil.updateResourceConfigNamespace(org.eclipse.jkube.kit.config.service.kubernetes.KubernetesClientUtil.updateResourceConfigNamespace) IOException(java.io.IOException) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) InputStreamReader(java.io.InputStreamReader) File(java.io.File) MojoFailureException(org.apache.maven.plugin.MojoFailureException) BuildReferenceDateUtil.getBuildTimestampFile(org.eclipse.jkube.kit.common.util.BuildReferenceDateUtil.getBuildTimestampFile) KitLogger(org.eclipse.jkube.kit.common.KitLogger) PlexusContainer(org.codehaus.plexus.PlexusContainer) DefaultEnricherManager(org.eclipse.jkube.kit.enricher.api.DefaultEnricherManager) EnricherContext(org.eclipse.jkube.kit.enricher.api.EnricherContext) Collections(java.util.Collections) DefaultEnricherManager(org.eclipse.jkube.kit.enricher.api.DefaultEnricherManager)

Aggregations

File (java.io.File)1 IOException (java.io.IOException)1 InputStreamReader (java.io.InputStreamReader)1 LineNumberReader (java.io.LineNumberReader)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1 URL (java.net.URL)1 StandardCharsets (java.nio.charset.StandardCharsets)1 Collections (java.util.Collections)1 Enumeration (java.util.Enumeration)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 DependencyResolutionRequiredException (org.apache.maven.artifact.DependencyResolutionRequiredException)1 MavenSession (org.apache.maven.execution.MavenSession)1 AbstractMojo (org.apache.maven.plugin.AbstractMojo)1 MojoExecution (org.apache.maven.plugin.MojoExecution)1 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)1 MojoFailureException (org.apache.maven.plugin.MojoFailureException)1 Component (org.apache.maven.plugins.annotations.Component)1