On Thu, May 3, 2018 at 2:38 AM, Thomas Weißschuh <[email protected]> wrote: > For this it is important that each single step has its own identity, that can > be accessed from within the step (eg maven in the `sh` step). > I am honestly not sure how it would be possible to get information for a > specific step from the REST API without having a way of knowing the identity > of > the current step in the first place.
Well, at least for `sh` steps you can identify the command line (in most cases) via `ArgumentsAction`. Note that my suggestion about defining environment variables in a custom block-scoped step may not fit your needs since the environment variables need to be defined before the body starts, so you could not include timing information about this step itself. >From my (again, weak) understanding of your goals, it might work better to use the `STAGE_NAME` environment variable from inside external processes to see where you are in the build, which can then be mapped back to build metadata via the flow graph. Or scripts could be amended slightly to just use `withEnv` to specify some arbitrary ID, accessible of course to external processes via environment, correlatable to the flow graph via `ArgumentsAction`. I suppose we could also amend `DefaultStepContext.get` to include a special variable bound to the current `FlowNode.id`; and/or more generally introduce an `ExtensionPoint` similar to `EnvironmentExpander` but accepting a `StepContext` argument (to be called from a new overload of `getEffectiveEnvironment`), so you could bind such a variable yourself. The latter would be an Enhancement with `api` label in `workflow-step-api-plugin` + `workflow-support-plugin`. -- 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/CANfRfr3OQy4ZCnmQhRo5MtUOdgZatp6QX5WYnAFE_q61hEYUgg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
