use of io.fabric8.maven.core.service.Fabric8ServiceHub in project fabric8-maven-plugin by fabric8io.
the class WatchMojo method customizeConfig.
@Override
public List<ImageConfiguration> customizeConfig(List<ImageConfiguration> configs) {
try {
Fabric8ServiceHub serviceHub = getFabric8ServiceHub();
GeneratorContext ctx = new GeneratorContext.Builder().config(extractGeneratorConfig()).project(project).session(session).goalFinder(goalFinder).goalName("fabric8:watch").logger(log).mode(mode).strategy(buildStrategy).useProjectClasspath(useProjectClasspath).artifactResolver(serviceHub.getArtifactResolverService()).build();
return GeneratorManager.generate(configs, ctx, false);
} catch (MojoExecutionException e) {
throw new IllegalArgumentException("Cannot extract generator config: " + e, e);
}
}
use of io.fabric8.maven.core.service.Fabric8ServiceHub in project fabric8-maven-plugin by fabric8io.
the class Fabric8ServiceHubTest method testObtainBuildService.
@Test
public void testObtainBuildService() {
Fabric8ServiceHub hub = new Fabric8ServiceHub.Builder().clusterAccess(clusterAccess).log(logger).platformMode(PlatformMode.kubernetes).dockerServiceHub(dockerServiceHub).buildServiceConfig(buildServiceConfig).build();
BuildService buildService = hub.getBuildService();
assertNotNull(buildService);
assertTrue(buildService instanceof DockerBuildService);
}
use of io.fabric8.maven.core.service.Fabric8ServiceHub in project fabric8-maven-plugin by fabric8io.
the class Fabric8ServiceHubTest method testObtainOpenshiftBuildService.
@Test
public void testObtainOpenshiftBuildService() {
Fabric8ServiceHub hub = new Fabric8ServiceHub.Builder().clusterAccess(clusterAccess).log(logger).platformMode(PlatformMode.openshift).dockerServiceHub(dockerServiceHub).buildServiceConfig(buildServiceConfig).build();
BuildService buildService = hub.getBuildService();
assertNotNull(buildService);
assertTrue(buildService instanceof OpenshiftBuildService);
}
Aggregations