-
Bug
-
Resolution: Not A Defect
-
Minor
-
None
-
Jenkins: 2.73.1
Pipeline: 2.5
Pipeline: Nodes and Processes: 2.17
Durable Task Plugin: 1.17
We are Working on a Scripted Pipeline managed with SCM.
Currently we are calling Class-Methods from the Pipeline to keep the code clean and Object orientated.
The Problem we encounter is that every Time we call the `sh` command the whole Body after that call will be skipped and the current state will return to the pipeline. This would be as follows:
pipeline.groovy ... ums = new UmsHandler(this) ums.getSessionID()
UmsHandler.groovy UmsHandler(steps) { this.steps = steps } @NonCPS String getSessionID() { def exitcode = steps.sh(script: "getSessionID", returnStatus: true) if (exitcode != 0) { foo } }
every Time we execute the command (and it is executed we log that on the Machine) the code after that execution won't be executed. The Script will return to the pipeline and proceed there.
I'm not sure if this is the correct way to execute a Command from a Class or even if this behavior is expected, but I would appropriate a Solution to this Problem.