diff options
author | Kevin Hilman <khilman@baylibre.com> | 2018-12-14 11:50:26 -0800 |
---|---|---|
committer | Guillaume Tucker <guillaume.tucker@collabora.com> | 2018-12-24 09:14:37 +0000 |
commit | fc367c2826ee1ae3cde5b67ae41871923ccf3e9e (patch) | |
tree | 2a5c44d3925e0fd1a692c90c6374d3af0b61565a /src | |
parent | ed3eb5bc39832f4bbe5d9c717aeb86cc7c9c4bd6 (diff) |
org.kernelci.util.Job: fix docker image names for clang
Clang installs are multi-arch, so only need one container per clang
version, and not per arch.
While adding this, clean things up so that default case is without arch
appended, and the gcc case (appended arch) is the special case.
Also fix an obvious variable name bug where the function parameter was
called 'kernel_arch' but the code was using 'arch'.
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/org/kernelci/util/Job.groovy | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/org/kernelci/util/Job.groovy b/src/org/kernelci/util/Job.groovy index 618ae40..51c007b 100644 --- a/src/org/kernelci/util/Job.groovy +++ b/src/org/kernelci/util/Job.groovy @@ -35,16 +35,22 @@ def addBoolParams(params, bool_params) { } def dockerImageName(base, cc, cc_version, kernel_arch) { - def docker_arch + def image_name = "${base}${cc}-${cc_version}" - if (arch == "riscv") - docker_arch = "riscv64" - else if ((arch == "i386") || (arch == "x86_64")) - docker_arch = "x86" - else - docker_arch = arch + if (cc == "gcc") { + def docker_arch - return "${base}${cc}-${cc_version}_${docker_arch}" + if (kernel_arch == "riscv") + docker_arch = "riscv64" + else if ((kernel_arch == "i386") || (kernel_arch == "x86_64")) + docker_arch = "x86" + else + docker_arch = kernel_arch + + image_name = "${image_name}_${docker_arch}" + } + + return image_name; } def dockerPullWithRetry(image_name, retries=10, sleep_time=1) { |