From dea2dbcbaafb29314118c5b536fc16fb219ecbbe Mon Sep 17 00:00:00 2001 From: Marcus Holl Date: Tue, 2 Apr 2019 09:33:40 +0200 Subject: [PATCH] neoDeploy: assert deployable exists before starting deployment. Up to now the presence of the deployable (source) was checked late by the NeoCommandLineHelper. The code doing this is surrounded by the try/catch which finally also puts the log written by the neo toolset into the job log in case an exception occured. The check for the deployable returns with the same type of exception like a failed neo command. Hence we cannot distiguish (ok, would be possible to parse the exception message, but that is ugly). When the exception is triggered by the missing deployable we try to cat the neo log into the job log. But at this point the neo log has not been provided - neo has not been called at all in this case. Hence `cat logs/neo/*` in turn fails. In order to avoid such a failure we check now for the presence of the deployable earlier before launching the neo toolset. Since the deployable is used in any deploy mode case no further check for the deploy mode is required prior to the check for the deployable. --- vars/neoDeploy.groovy | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vars/neoDeploy.groovy b/vars/neoDeploy.groovy index 7a6f3e7b2..19f4ddba4 100644 --- a/vars/neoDeploy.groovy +++ b/vars/neoDeploy.groovy @@ -1,5 +1,6 @@ import com.sap.piper.ConfigurationHelper import com.sap.piper.Utils +import com.sap.piper.StepAssertions import com.sap.piper.tools.neo.DeployMode import com.sap.piper.tools.neo.NeoCommandHelper import com.sap.piper.tools.neo.WarAction @@ -88,6 +89,9 @@ void call(parameters = [:]) { dockerEnvVars: configuration.dockerEnvVars, dockerOptions: configuration.dockerOptions ) { + + StepAssertions.assertFileExists(this, configuration.source) + NeoCommandHelper neoCommandHelper = new NeoCommandHelper( this, deployMode,