On Thu, Dec 10, 2020 at 4:26 AM Lakshmi Narasimhan
<[email protected]> 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`.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr0o1KLdpNpWVarYoycm5v_hKBofXeVyyoYcTiN8JeRQDQ%40mail.gmail.com.

Reply via email to