fitzoh
08/24/2017, 6:05 PMbamboo
08/24/2017, 6:14 PMdoFirst { ... }
fitzoh
08/24/2017, 6:46 PM@Test
fun `it sets the image`() {
project.extensions.getByType(MyExtension::class.java).dockerRepository = "<http://myregistry.com/some/repo|myregistry.com/some/repo>"
val buildDockerImage = project.tasks.getByName("buildDockerImage") as Exec
//Run the `doFirst`
val action = buildDockerImage.actions[0] as Action<Task>
action.execute(buildDockerImage)
assertThat(buildDockerImage.commandLine)
.containsExactly("docker", "build", "-t", "<http://myregistry.com/some/repo|myregistry.com/some/repo>", "docker")
}
mkobit
08/25/2017, 6:06 PMProvider
and PropertyState
types, which might help too