aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Tucker <guillaume.tucker@collabora.com>2018-11-28 23:25:10 +0000
committerGuillaume Tucker <guillaume.tucker@collabora.com>2018-12-07 13:23:52 +0000
commit327394a1271b4e3ab403d33b12f080156f7489bd (patch)
tree322491e96abe3e42cfd006f2df7907b9f3637175 /src
parent401ce3d1cd0c6e00c71b3cc6a856f77d2510592f (diff)
org.kernelci.util.Job: add dockerImageName() and use it
Add Job.dockerImageName() to construct the name of the Docker image for a given combination of Docker base name, compiler and architecture. This is then used both in build.jpl and bisect.jpl to ensure they are both using the same Docker images to build kernels. Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Diffstat (limited to 'src')
-rw-r--r--src/org/kernelci/util/Job.groovy13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/org/kernelci/util/Job.groovy b/src/org/kernelci/util/Job.groovy
index 79a69ae..d24663a 100644
--- a/src/org/kernelci/util/Job.groovy
+++ b/src/org/kernelci/util/Job.groovy
@@ -34,6 +34,19 @@ def addBoolParams(params, bool_params) {
}
}
+def dockerImageName(base, compiler, kernel_arch) {
+ def docker_arch
+
+ if (arch == "riscv")
+ docker_arch = "riscv64"
+ else if ((arch == "i386") || (arch == "x86_64"))
+ docker_arch = "x86"
+ else
+ docker_arch = arch
+
+ return "${base}${compiler}_${docker_arch}"
+}
+
def dockerPullWithRetry(image_name, retries=10, sleep_time=1) {
def image = docker.image(image_name)
def pulled = false