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());
}
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);
}
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
}
Aggregations