use of io.fabric8.maven.core.config.OpenShiftBuildStrategy in project fabric8-maven-plugin by fabric8io.
the class OpenshiftBuildServiceTest method init.
@Before
public void init() throws Exception {
final File dockerFile = new File(baseDir, "Docker.tar");
dockerFile.getParentFile().mkdirs();
dockerFile.createNewFile();
imageStreamFile.delete();
new Expectations() {
{
dockerServiceHub.getArchiveService();
result = archiveService;
archiveService.createDockerBuildArchive(withAny(ImageConfiguration.class.cast(null)), withAny(MojoParameters.class.cast(null)));
result = dockerFile;
minTimes = 0;
project.getArtifact();
result = "myapp";
minTimes = 0;
dockerMojoParameters.getProject();
result = project;
minTimes = 0;
}
};
image = new ImageConfiguration.Builder().name(projectName).buildConfig(new BuildImageConfiguration.Builder().from(projectName).build()).build();
defaultConfig = new BuildService.BuildServiceConfig.Builder().buildDirectory(baseDir).buildRecreateMode(BuildRecreateMode.none).s2iBuildNameSuffix("-s2i-suffix2").openshiftBuildStrategy(OpenShiftBuildStrategy.s2i).dockerMojoParameters(dockerMojoParameters);
}
use of io.fabric8.maven.core.config.OpenShiftBuildStrategy in project fabric8-maven-plugin by fabric8io.
the class JavaRunGeneratorTest method fromSelector.
@Test
public void fromSelector() throws IOException {
Object[] data = { "3.1.123", PlatformMode.kubernetes, null, "java.upstream.docker", "3.1.redhat-101", PlatformMode.kubernetes, null, "java.redhat.docker", "3.1.123", PlatformMode.openshift, OpenShiftBuildStrategy.docker, "java.upstream.docker", "3.1.redhat-101", PlatformMode.openshift, OpenShiftBuildStrategy.docker, "java.redhat.docker", "3.1.123", PlatformMode.openshift, OpenShiftBuildStrategy.s2i, "java.upstream.s2i", "3.1.redhat-101", PlatformMode.openshift, OpenShiftBuildStrategy.s2i, "java.redhat.s2i" };
Properties imageProps = getDefaultImageProps();
for (int i = 0; i < data.length; i += 4) {
prepareExpectation((String) data[i], (PlatformMode) data[i + 1], (OpenShiftBuildStrategy) data[i + 2]);
final GeneratorContext context = ctx;
FromSelector selector = new FromSelector.Default(context, "java");
String from = selector.getFrom();
assertEquals(imageProps.getProperty((String) data[i + 3]), from);
}
}
use of io.fabric8.maven.core.config.OpenShiftBuildStrategy in project fabric8-maven-plugin by fabric8io.
the class FromSelector method getFrom.
public String getFrom() {
PlatformMode mode = context.getMode();
OpenShiftBuildStrategy strategy = context.getStrategy();
if (mode == PlatformMode.openshift && strategy == OpenShiftBuildStrategy.s2i) {
return getS2iBuildFrom();
} else {
return getDockerBuildFrom();
}
}
Aggregations