Skip to content

Commit

Permalink
Plugin distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Marcinkowski committed Aug 9, 2019
1 parent b2b648c commit 85dead0
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
7 changes: 2 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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}")) }
}
Expand All @@ -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")

2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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
21 changes: 20 additions & 1 deletion gradle/docker.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ buildscript {

val dockerImageRef = "$buildDir/.docker/buildImage-imageId.txt"


tasks.register<Copy>("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"

Expand Down Expand Up @@ -89,4 +100,12 @@ tasks.create("runTest", Test::class) {
finalizedBy(stopContainer)

include("**/*ITCase*")
}
}

tasks.register("prepareDocker") {
dependsOn("cleanDistribution", "assembleBaseDistribution", "copyDockerfile")
}

/*tasks.register("prepareDocker") {
dependsOn("cleanDistribution", "copyModulesWithDeps", "copyBin", "copyConfigs", "copyDockerfile")
}*?
6 changes: 6 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 85dead0

Please sign in to comment.