On Thu, Dec 10, 2020 at 4:26 AM Lakshmi Narasimhan
<
vaikuntam....@gmail.com> wrote:
> I am trying to understand how I can leverage SimpleBuildWrapper to be able to work in different job types.
`SimpleBuildWrapper` is specifically designed (in fact restricted) to
be compatible with traditional job types as well as Pipeline. Please
read
https://www.jenkins.io/doc/developer/plugin-development/pipeline-integration/
> step ([$class: "MyStepClass"...] // This performs some action and has the return values (name-value pairs)
No, you just define a `@Symbol` and that becomes a Pipeline step name.
> I am tending towards doing this through an intermediate action
`Run.addAction` affects the build globally, which will lead to
incorrect or confused results if a Pipeline build uses the wrapper
multiple times, or does work after the block ends, or (especially) if
the wrapper is run in parallel. So avoid that.
From a `SimpleBuildWrapper` you can communicate information to nested
steps using simple (textual) environment variables. If you need to
communicate richer substructure contextually, you will need to use
`Step` and check the documentation on `BodyInvoker`.