Contents
How to get current stage status of Jenkins pipeline?
If I want to get the current status of the pipeline itself, I can use currentBuild.getCurrentResult () but I don’t see a currentStage analog to this. I’m interested in trying out a pattern that might look something like this in my stages: but that would fail because there’s no currentStage available.
What is the result of Jenkins step Stack Overflow?
This output would tell you that the result (in this case) is a org.jenkinsci.plugins.workflow.support.steps.build.RunWrapper which has published Javadoc. For other cases, I usually have to dive into the Jenkins source code. Here is my general strategy: Search for the String literal of the step name, and find the step type that returns it.
How to get current stage status of pipeline?
It turns out I can keep a pipeline as SUCCESS but can mark an individual stage as UNSTABLE if I want via catchError like this: If I want to get the current status of the pipeline itself, I can use currentBuild.getCurrentResult () but I don’t see a currentStage analog to this.
How to print out the result object in Jenkins?
One easy way would be to just print out the class of the result object by calling getClass: This output would tell you that the result (in this case) is a org.jenkinsci.plugins.workflow.support.steps.build.RunWrapper which has published Javadoc. For other cases, I usually have to dive into the Jenkins source code.
How to properly achieve dynamic parallel action in Jenkins?
It’s much easier to use scripted Pipelines to do this since you can use arbitrary Groovy, but you should still be able to do this with declarative Pipelines using the findFiles step. Thanks for contributing an answer to DevOps Stack Exchange!
Can a parallel branch be run on a different agent?
For example, to run each parallel branch on a different agent, you need to use a node step, and if you do that, the output of the parallel branch won’t be available for post directives (at a stage or pipeline level). Basically the old parallel step required you to use Scripted Pipeline within a Declarative Pipeline.
How is the build step used in Jenkins?
In this integration pipeline in Jenkins, I am triggering different builds in parallel using the build step, as follows: