Make image prefix configurable.
Adds a new parameter to docker.gradle `dockerImagePrefix` which specifies the PREFIX part in the following format: {REGISTRY}/{PREFIX}/{IMAGE}:{TAG}. This used to be hardcoded to "whisk", e.g. whisk/controller.
Implements a parameter for ansible to pull an image prefixed by "docker_image_prefix" (PREFIX in the following format): {REGISTRY}/{PREFIX}/{IMAGE}:{TAG}. Was previously hardcoded as "whisk".
Writes the parameter into whisk.properties and makes the invoker pick it up for spawning containers.
Add different tag in travis to flesh out problems.
diff --git a/tools/cli/build.gradle b/tools/cli/build.gradle
index eaeb6ad..4b46d1d 100644
--- a/tools/cli/build.gradle
+++ b/tools/cli/build.gradle
@@ -6,7 +6,8 @@
}
}
-ext.dockerImageName = 'whisk/cli'
+ext.dockerImageName = 'cli'
+ext.dockerContainerName = 'cli'
apply from: '../../gradle/docker.gradle'
task clean(type: Delete) {
@@ -36,18 +37,18 @@
distDocker.dependsOn(establishStructure)
task distTar(dependsOn: [removeDistribution, distDocker]) << {
- run("docker rm -f cli", true) // Ignore error as this is a cleanup measure
- run("docker run --name cli whisk/cli")
- run("docker cp cli:/cli/dist/ \"${buildDir}/distributions/\"")
- run("docker rm -f cli")
+ run(dockerBinary + ["rm", "-f", dockerContainerName], true)
+ run(dockerBinary + ["run", "--name", dockerContainerName, dockerTaggedImageName])
+ run(dockerBinary + ["cp", dockerContainerName + ":/cli/dist/", "${buildDir}/distributions/"])
+ run(dockerBinary + ["rm", "-f", dockerContainerName])
}
pushImage.finalizedBy(distTar)
def run(cmd, ignoreError = false) {
- println("Executing '${cmd}'")
+ println("Executing '${cmd.join(" ")}'")
def proc = cmd.execute()
proc.waitFor()
if(!ignoreError && proc.exitValue() != 0) {
- println("Command '${cmd}' failed with exitCode ${proc.exitValue()}")
+ println("Command '${cmd.join(" ")}' failed with exitCode ${proc.exitValue()}")
}
}