From c6450875170a5f320ac91facf1846036140dcd19 Mon Sep 17 00:00:00 2001 From: Sven Merk <33895725+nevskrem@users.noreply.github.com> Date: Wed, 11 Mar 2020 10:05:03 +0100 Subject: [PATCH] NotSerializableException next part (#1262) * Update dockerExecute.groovy * Update dockerExecute.groovy * Update dockerExecute.groovy --- vars/dockerExecute.groovy | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vars/dockerExecute.groovy b/vars/dockerExecute.groovy index 725a58f04..30e2d92f9 100644 --- a/vars/dockerExecute.groovy +++ b/vars/dockerExecute.groovy @@ -265,20 +265,20 @@ private getDockerOptions(Map dockerEnvVars, Map dockerVolumeBind, def dockerOpti ] def options = [] if (dockerEnvVars) { - for (String k : dockerEnvVars.keySet()) { - options.add("--env ${k}=${dockerEnvVars[k].toString()}") + dockerEnvVars.each { String k, v -> + options.add("--env ${k}=${v.toString()}") } } - for (String envVar : specialEnvironments) { + specialEnvironments.each { String envVar -> if (dockerEnvVars == null || !dockerEnvVars.containsKey(envVar)) { options.add("--env ${envVar}") } } if (dockerVolumeBind) { - for (String k : dockerVolumeBind.keySet()) { - options.add("--volume ${k}:${dockerVolumeBind[k].toString()}") + dockerVolumeBind.each { String k, v -> + options.add("--volume ${k}:${v.toString()}") } } @@ -287,7 +287,7 @@ private getDockerOptions(Map dockerEnvVars, Map dockerVolumeBind, def dockerOpti dockerOptions = [dockerOptions] } if (dockerOptions instanceof List) { - for (String option : dockerOptions) { + dockerOptions.each { String option -> options << escapeBlanks(option) } } else {