Search in sources :

Example 1 with JibBuildService

use of io.fabric8.maven.docker.service.JibBuildService in project docker-maven-plugin by fabric8io.

the class BuildMojo method proceedWithJibBuild.

private void proceedWithJibBuild(ServiceHub hub, BuildService.BuildContext buildContext, ImageConfiguration imageConfig) throws MojoExecutionException {
    log.info("Building Container image with [[B]]JIB(Java Image Builder)[[B]] mode");
    new JibBuildService(hub, createMojoParameters(), log).build(jibImageFormat, imageConfig, buildContext.getRegistryConfig());
}
Also used : JibBuildService(io.fabric8.maven.docker.service.JibBuildService)

Example 2 with JibBuildService

use of io.fabric8.maven.docker.service.JibBuildService in project docker-maven-plugin by fabric8io.

the class PushMojo method executeJibPush.

private void executeJibPush(ServiceHub hub) throws MojoExecutionException {
    log.info("Pushing Container image with [[B]]JIB(Java Image Builder)[[B]] mode");
    JibBuildService jibBuildService = new JibBuildService(hub, new MojoParameters(session, project, null, null, null, settings, sourceDirectory, outputDirectory, null), log);
    jibBuildService.push(getResolvedImages(), retries, getRegistryConfig(pushRegistry), skipTag);
}
Also used : JibBuildService(io.fabric8.maven.docker.service.JibBuildService) MojoParameters(io.fabric8.maven.docker.util.MojoParameters)

Example 3 with JibBuildService

use of io.fabric8.maven.docker.service.JibBuildService in project docker-maven-plugin by fabric8io.

the class JibBuildServiceTest method testPushWithConfiguration.

@Test
public void testPushWithConfiguration(@Mocked JibServiceUtil jibServiceUtil) throws Exception {
    // Given
    File projectBaseDir = Files.createTempDirectory("test").toFile();
    setupServiceHubExpectations(projectBaseDir);
    final ImageConfiguration imageConfiguration = getImageConfiguration();
    final RegistryService.RegistryConfig registryConfig = new RegistryService.RegistryConfig.Builder().authConfigFactory(authConfigFactory).build();
    mockAuthConfigFactory(true, registryConfig);
    // When
    new JibBuildService(serviceHub, params, logger).push(Collections.singletonList(imageConfiguration), 1, registryConfig, false);
    // Then
    // @formatter:off
    new Verifications() {

        {
            JibServiceUtil.jibPush(imageConfiguration, Credential.from("testuserpush", "testpass"), (File) any, logger);
            times = 1;
        }
    };
// @formatter:on
}
Also used : BuildImageConfiguration(io.fabric8.maven.docker.config.BuildImageConfiguration) ImageConfiguration(io.fabric8.maven.docker.config.ImageConfiguration) Verifications(mockit.Verifications) File(java.io.File) Test(org.junit.Test)

Aggregations

JibBuildService (io.fabric8.maven.docker.service.JibBuildService)2 BuildImageConfiguration (io.fabric8.maven.docker.config.BuildImageConfiguration)1 ImageConfiguration (io.fabric8.maven.docker.config.ImageConfiguration)1 MojoParameters (io.fabric8.maven.docker.util.MojoParameters)1 File (java.io.File)1 Verifications (mockit.Verifications)1 Test (org.junit.Test)1