From d1613e8937af341f477c793ba83c97d539695003 Mon Sep 17 00:00:00 2001 From: alingenhag <11538311+alingenhag@users.noreply.github.com> Date: Thu, 26 Dec 2019 16:19:22 +0100 Subject: [PATCH] Add possibility to add a config dir to the docker context. --- src/main/kotlin/rule/Docker.kt | 1 + src/main/kotlin/rule/DockerImageRule.kt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/main/kotlin/rule/Docker.kt b/src/main/kotlin/rule/Docker.kt index 5d2394c..d49990c 100644 --- a/src/main/kotlin/rule/Docker.kt +++ b/src/main/kotlin/rule/Docker.kt @@ -10,6 +10,7 @@ interface Docker { var relativeDockerfilePath: String var artifactName: String var artifactPath: String + var artifactConfig: File? var tag: String var host: String var imageId: File diff --git a/src/main/kotlin/rule/DockerImageRule.kt b/src/main/kotlin/rule/DockerImageRule.kt index 43f93da..d3333a9 100644 --- a/src/main/kotlin/rule/DockerImageRule.kt +++ b/src/main/kotlin/rule/DockerImageRule.kt @@ -33,6 +33,7 @@ class DockerImageRule : RuleSource() { val warTask: War = project.tasks["war"] as War docker.artifactPath = warTask.project.relativePath(warTask.archiveFile.get().asFile) docker.artifactName = warTask.archiveFileName.get() + docker.artifactConfig = File(warTask.project.relativePath("src/main/liberty")) } else { docker.artifactPath = jarTask.project.relativePath(jarTask.archiveFile.get().asFile) docker.artifactName = jarTask.archiveFileName.get() @@ -48,6 +49,7 @@ class DockerImageRule : RuleSource() { from(docker.sourceContextPath) from(docker.artifactPath) + from(docker.artifactConfig) into(docker.contextDirectory) }