use of io.fabric8.maven.docker.config.ImageConfiguration in project docker-maven-plugin by fabric8io.
the class PropertyConfigHandlerTest method testResolve.
@Test
public void testResolve() {
ImageConfiguration resolved = resolveExternalImageConfig(getTestData());
validateBuildConfiguration(resolved.getBuildConfiguration());
validateRunConfiguration(resolved.getRunConfiguration());
// validateWaitConfiguraion(resolved.getRunConfiguration().getWaitConfiguration());
}
use of io.fabric8.maven.docker.config.ImageConfiguration in project docker-maven-plugin by fabric8io.
the class PropertyConfigHandlerTest method testDockerfile.
@Test
public void testDockerfile() throws Exception {
String[] testData = new String[] { k(ConfigKey.NAME), "image", k(ConfigKey.DOCKER_FILE_DIR), "src/main/docker/", k(ConfigKey.FROM), "busybox" };
ImageConfiguration config = resolveExternalImageConfig(testData);
config.initAndValidate(ConfigHelper.NameFormatter.IDENTITY, null);
assertTrue(config.getBuildConfiguration().isDockerFileMode());
assertEquals(new File("src/main/docker/Dockerfile"), config.getBuildConfiguration().getDockerFile());
}
use of io.fabric8.maven.docker.config.ImageConfiguration in project docker-maven-plugin by fabric8io.
the class PropertyConfigHandlerTest method testSpecificEnv.
@Test
public void testSpecificEnv() throws Exception {
List<ImageConfiguration> configs = resolveImage(imageConfiguration, props("docker.from", "baase", "docker.name", "demo", "docker.envBuild.HOME", "/tmp", "docker.envRun.root.dir", "/bla"));
assertEquals(1, configs.size());
ImageConfiguration calcConfig = configs.get(0);
Map<String, String> env;
env = calcConfig.getBuildConfiguration().getEnv();
assertEquals(1, env.size());
assertEquals("/tmp", env.get("HOME"));
env = calcConfig.getRunConfiguration().getEnv();
assertEquals(1, env.size());
assertEquals("/bla", env.get("root.dir"));
}
use of io.fabric8.maven.docker.config.ImageConfiguration in project docker-maven-plugin by fabric8io.
the class PropertyConfigHandlerTest method testCleanupDefault.
@Test
public void testCleanupDefault() {
String[] testData = new String[] { k(ConfigKey.NAME), "image", k(ConfigKey.FROM), "base" };
ImageConfiguration config = resolveExternalImageConfig(testData);
assertEquals(DEFAULT_CLEANUP, config.getBuildConfiguration().cleanupMode().toParameter());
}
use of io.fabric8.maven.docker.config.ImageConfiguration in project docker-maven-plugin by fabric8io.
the class PropertyConfigHandlerTest method testEnvAndLabels.
@Test
public void testEnvAndLabels() throws Exception {
List<ImageConfiguration> configs = resolveImage(imageConfiguration, props("docker.from", "baase", "docker.name", "demo", "docker.env.HOME", "/tmp", "docker.env.root.dir", "/bla", "docker.labels.version", "1.0.0", "docker.labels.blub.bla.foobar", "yep"));
assertEquals(1, configs.size());
ImageConfiguration calcConfig = configs.get(0);
for (Map env : new Map[] { calcConfig.getBuildConfiguration().getEnv(), calcConfig.getRunConfiguration().getEnv() }) {
assertEquals(2, env.size());
assertEquals("/tmp", env.get("HOME"));
assertEquals("/bla", env.get("root.dir"));
}
for (Map labels : new Map[] { calcConfig.getBuildConfiguration().getLabels(), calcConfig.getRunConfiguration().getLabels() }) {
assertEquals(2, labels.size());
assertEquals("1.0.0", labels.get("version"));
assertEquals("yep", labels.get("blub.bla.foobar"));
}
}
Aggregations