fixed logic to determine location of dockerfile if dockerFile and dockerFileDir also set
@@ -64,6 +64,26 @@ public class BuildImageConfigurationTest {
assertEquals(config.getDockerFile(),new File("src/docker/Dockerfile"));
}
+ @Test
+ public void DockerfileDirAndDockerfileAlsoSet() {
+ BuildImageConfiguration config =
+ new BuildImageConfiguration.Builder().
+ dockerFileDir("/tmp/").
+ dockerFile("Dockerfile").build();
+ config.initAndValidate(logger);
+ assertTrue(config.isDockerFileMode());
+ assertEquals(config.getDockerFile(),new File("/tmp/Dockerfile"));
+ }
+
+ @Test(expected=IllegalArgumentException.class)
+ public void DockerfileDirAndDockerfileAlsoSetButDockerfileIsAbsoluteExceptionThrown() {
+ BuildImageConfiguration config =
+ new BuildImageConfiguration.Builder().
+ dockerFileDir("/tmp/").
+ dockerFile("/Dockerfile").build();
+ config.initAndValidate(logger);
+ }
+
@Test
public void deprecatedDockerfileDir() {
AssemblyConfiguration assemblyConfig = new AssemblyConfiguration.Builder().dockerFileDir("src/docker").build();
