From 85dead02ab8a63222185fc42e3d6f7ce89c13094 Mon Sep 17 00:00:00 2001 From: Piotr Marcinkowski Date: Fri, 9 Aug 2019 13:52:56 +0200 Subject: [PATCH] Plugin distribution --- build.gradle.kts | 7 ++----- docker/Dockerfile | 2 +- gradle.properties | 4 +++- gradle/docker.gradle.kts | 21 ++++++++++++++++++++- settings.gradle.kts | 6 ++++++ 5 files changed, 32 insertions(+), 8 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 1613a38..760515e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,14 +14,11 @@ * limitations under the License. */ plugins { + id("io.knotx.distribution") version "0.1.2" id("com.bmuschko.docker-remote-api") version "4.9.0" id("java") } -configurations { - register("dist") -} - dependencies { subprojects.forEach { "dist"(project(":${it.name}")) } } @@ -46,7 +43,7 @@ tasks.named("build") { dependsOn("runTest") } -apply(from = "gradle/distribution.gradle.kts") +//apply(from = "gradle/distribution.gradle.kts") apply(from = "gradle/javaAndUnitTests.gradle.kts") apply(from = "gradle/docker.gradle.kts") diff --git a/docker/Dockerfile b/docker/Dockerfile index c529532..36fe181 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,7 +2,7 @@ FROM knotx/knotx:$knotx_version LABEL maintainer="Knot.x Project" -COPY ./knotx /usr/local/knotx +COPY ./out/knotx /usr/local/knotx HEALTHCHECK --interval=5s --timeout=2s --retries=12 \ CMD curl --silent --fail localhost:8092/healthcheck || exit 1 diff --git a/gradle.properties b/gradle.properties index ff98615..f6018f9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,6 @@ version=0.0.1-SNAPSHOT -# Knot.x Docker image version (https://hub.docker.com/r/knotx/knotx) knotx.version=2.0.0-RC5 +# Knot.x Docker image version (https://hub.docker.com/r/knotx/knotx) +knotx.docker.version=edge +knotx.conf=knotx docker.image.name=knotx/knotx-starter-kit \ No newline at end of file diff --git a/gradle/docker.gradle.kts b/gradle/docker.gradle.kts index 88d3448..ac4d99d 100644 --- a/gradle/docker.gradle.kts +++ b/gradle/docker.gradle.kts @@ -31,6 +31,17 @@ buildscript { val dockerImageRef = "$buildDir/.docker/buildImage-imageId.txt" + +tasks.register("copyDockerfile") { + group = "docker" + + from("docker") + into("$buildDir") + expand("knotx_version" to project.property("knotx.docker.version")) + + mustRunAfter("cleanDistribution") +} + tasks.create("removeImage", DockerRemoveImage::class) { group = "docker" @@ -89,4 +100,12 @@ tasks.create("runTest", Test::class) { finalizedBy(stopContainer) include("**/*ITCase*") -} \ No newline at end of file +} + +tasks.register("prepareDocker") { + dependsOn("cleanDistribution", "assembleBaseDistribution", "copyDockerfile") +} + +/*tasks.register("prepareDocker") { + dependsOn("cleanDistribution", "copyModulesWithDeps", "copyBin", "copyConfigs", "copyDockerfile") +}*? diff --git a/settings.gradle.kts b/settings.gradle.kts index 4c5d085..b16f188 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -13,6 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +pluginManagement { + repositories { + gradlePluginPortal() + mavenLocal() + } +} rootProject.name = "knotx-starter-kit" include("example-api")