<NME> build.gradle
<BEF> apply plugin: "org.asciidoctor.jvm.convert"

project.parent.tasks.collectDocumentation.dependsOn project.tasks.asciidoctor

// This is needed cause some things like attributes for asciidoctor don't serialize project.version properly at runtime
def genieVersion = project.version.toString()

asciidoctor {
    baseDirFollowsSourceDir()
}

asciidoctorj {
    attributes(["revnumber": genieVersion, "docinfo1": ""])
}

def apacheImageName = "genie-demo-apache"
def clientImageName = "genie-demo-client"

task dockerBuildApacheImage(type: Exec, group: "Docker", description: "Build docker image for demo apache") {
    onlyIf {
        rootProject.ext.isDockerRunning()
    }
    commandArgs.add("docker")
    commandArgs.add("build")
    commandArgs.add("--force-rm")
    for (String tag : this.getDockerTags(apacheImageName)) {
        commandArgs.add("-t")
        commandArgs.add(tag)
    }
    for (String tag : rootProject.ext.getDockerTags(apacheImageName, project.version.toString())) {
        commandArgs.add("-t")
        commandArgs.add(tag)
    }
    commandArgs.add(".")

    commandLine commandArgs
}

    commandArgs.add("docker")
    commandArgs.add("build")
    commandArgs.add("--force-rm")
    for (String tag : this.getDockerTags(clientImageName)) {
        commandArgs.add("-t")
        commandArgs.add(tag)
    }
    def commandArgs = new ArrayList<>()
    commandArgs.add("docker")
    commandArgs.add("build")
    commandArgs.add("--force-rm")
    for (String tag : rootProject.ext.getDockerTags(clientImageName, project.version.toString())) {
        commandArgs.add("-t")
        commandArgs.add(tag)
    }
        System.env."CI"
    }
    doLast {
        for (String tag : this.getDockerTags(apacheImageName)) {
            exec {
                commandLine "docker", "push", tag
            }
        }
        for (String tag : this.getDockerTags(clientImageName)) {
            exec {
                commandLine "docker", "push", tag
            }
            exec {
                commandLine "docker", "push", tag
            }
        }
        for (String tag : rootProject.ext.getDockerTags(clientImageName, project.version.toString())) {
            exec {
                commandLine "docker", "push", tag
            }
        }
    }
}

<MSG> Modify how docker images are tagged

Generate convenient `latest.release`, `latest.candidate` or `latest.snapshot` tags which can be used to float on certain project status trains beyond just the standard `latest`

Clean up Gradle function definitions using extension instead with closure

<DFF> @@ -23,7 +23,7 @@ task dockerBuildApacheImage(type: Exec, group: "Docker", description: "Build doc
     commandArgs.add("docker")
     commandArgs.add("build")
     commandArgs.add("--force-rm")
-    for (String tag : this.getDockerTags(apacheImageName)) {
+    for (String tag : rootProject.ext.getDockerTags(apacheImageName, project.version.toString())) {
         commandArgs.add("-t")
         commandArgs.add(tag)
     }
@@ -39,7 +39,7 @@ task dockerBuildClientImage(type: Exec, group: "Docker", description: "Build doc
     commandArgs.add("docker")
     commandArgs.add("build")
     commandArgs.add("--force-rm")
-    for (String tag : this.getDockerTags(clientImageName)) {
+    for (String tag : rootProject.ext.getDockerTags(clientImageName, project.version.toString())) {
         commandArgs.add("-t")
         commandArgs.add(tag)
     }
@@ -54,12 +54,12 @@ task dockerPush(group: "Docker", description: "Push the demo docker images to do
         System.env."CI"
     }
     doLast {
-        for (String tag : this.getDockerTags(apacheImageName)) {
+        for (String tag : rootProject.ext.getDockerTags(apacheImageName, project.version.toString())) {
             exec {
                 commandLine "docker", "push", tag
             }
         }
-        for (String tag : this.getDockerTags(clientImageName)) {
+        for (String tag : rootProject.ext.getDockerTags(clientImageName, project.version.toString())) {
             exec {
                 commandLine "docker", "push", tag
             }

Modify how docker images are tagged