From 3f878e05c4b78eaaa4a93f3b0ff72558a370c802 Mon Sep 17 00:00:00 2001 From: Joshua Fernandes Date: Fri, 5 Jul 2019 08:35:52 +1000 Subject: [PATCH] remove the docker gradle plugin, handle building docker with shell now (#1644) * remove the docker gradle plugin, handle with shell now Signed-off-by: Adrian Sutton --- Jenkinsfile | 2 +- build.gradle | 25 ++++++++++++++++--------- kubernetes/.gitignore | 3 +++ 3 files changed, 20 insertions(+), 10 deletions(-) create mode 100644 kubernetes/.gitignore diff --git a/Jenkinsfile b/Jenkinsfile index e3788abd6f..f0994dcec1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -193,7 +193,7 @@ try { } stage(stage_name + 'Build image') { - sh './gradlew docker' + sh './gradlew distDocker' } stage(stage_name + "Test image labels") { diff --git a/build.gradle b/build.gradle index 6d79182a65..453f0a2302 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,6 @@ plugins { id 'me.champeau.gradle.jmh' version '0.4.8' apply false id 'net.ltgt.errorprone' version '0.8.1' id 'net.researchgate.release' version '2.7.0' - id "com.palantir.docker" version "0.22.1" } group = 'tech.pegasys.pantheon' @@ -481,6 +480,7 @@ distZip { // simple for use in docker tasks.register("dockerDistUntar") { dependsOn distTar + dependsOn distZip def dockerBuildDir = "build/docker-pantheon/" def distTarFile = distTar.outputs.files.singleFile def distTarFileName = distTar.outputs.files.singleFile.name.replace(".tar.gz", "") @@ -495,15 +495,22 @@ tasks.register("dockerDistUntar") { } } -docker { - def image_tag = "develop" +task distDocker(type: Exec) { dependsOn dockerDistUntar - name "pegasyseng/pantheon-kubernetes:${image_tag}" - dockerfile file('kubernetes/Dockerfile') - files "build/docker-pantheon/" - buildArgs(['BUILD_DATE': buildTime(), 'VERSION': rootProject.version, 'VCS_REF': getCheckedOutGitCommitHash()]) - pull true - noCache true + def image_tag = "develop" + def image="pegasyseng/pantheon-kubernetes:${image_tag}" + def dockerBuildDir = "build/docker-pantheon/" + workingDir "${dockerBuildDir}" + + doFirst { + copy { + from file("${projectDir}/kubernetes/Dockerfile") + into(workingDir) + } + } + + executable "sh" + args "-c", "docker build --build-arg BUILD_DATE=${buildTime()} --build-arg VERSION=${rootProject.version} --build-arg VCS_REF=${getCheckedOutGitCommitHash()} -t ${image} ." } task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) { diff --git a/kubernetes/.gitignore b/kubernetes/.gitignore new file mode 100644 index 0000000000..cd6c6bdf82 --- /dev/null +++ b/kubernetes/.gitignore @@ -0,0 +1,3 @@ +pantheon-*.tar.gz +pantheon/* +pantheon-* \ No newline at end of file