From 2b1b74308245c6b661042c6808042689f39bfed0 Mon Sep 17 00:00:00 2001 From: Marcus Holl Date: Fri, 29 Mar 2019 16:31:09 +0100 Subject: [PATCH] provide the log in case of a failure always, not only in docker context from property dockerImage we cannot conclude that we are in fact running inside a docker environment. Step dockerExecute has some checks if we are in a docker context. If not there is a fallback to the local environment. The docker image property is provided from resources/default_pipeline_environment (value: 's4sdk/docker-neo-cli'). Hence a value will be present all the time (exception: someone configured null/ empty string explicitly). So we will enter the corresponding code block anyway. It is IMO also desirable to have the neo log in the job log when running inside a non-docker setup since this simplifies troubleshooting anyway. --- vars/neoDeploy.groovy | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/vars/neoDeploy.groovy b/vars/neoDeploy.groovy index 7a6f3e7b2..1d265a4fc 100644 --- a/vars/neoDeploy.groovy +++ b/vars/neoDeploy.groovy @@ -137,10 +137,8 @@ private deploy(script, utils, Map configuration, NeoCommandHelper neoCommandHelp } } catch (Exception ex) { - if (dockerImage) { - echo "Error while deploying to SAP Cloud Platform. Here are the neo.sh logs:" - sh "cat logs/neo/*" - } + echo "Error while deploying to SAP Cloud Platform. Here are the neo.sh logs:" + sh "cat logs/neo/*" throw ex } }