Is it possible to log ENV for all pipelines?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Is it possible to log ENV for all pipelines?

Daniel Schmidt
Hi folks,

Many of our Declarative Pipeline jobs start off by printing environment variables, which aids in debugging (should that be necessary). In other words, the first stage of every job includes this step:
sh "env | sort"

Is it possible to hook this into all pipelines automatically, e.g. with a "pipeline decorator" or metaprogramming? Alternatively, is there a better solution for inspecting the ENV of builds which have already completed?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b5e83af4-9584-4849-8730-85b0bd2191b7%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to log ENV for all pipelines?

João Pinto
Look into shared pipeline libraries (
https://jenkins.io/doc/book/pipeline/shared-libraries/) for having a
common step defined for several pipelines.

João

On Wed, 2020-01-08 at 15:42 -0800, Daniel Schmidt wrote:

> Hi folks,
>
> Many of our Declarative Pipeline jobs start off by printing
> environment variables, which aids in debugging (should that be
> necessary). In other words, the first stage of every job includes
> this step:
> sh "env | sort"
>
> Is it possible to hook this into all pipelines automatically, e.g.
> with a "pipeline decorator" or metaprogramming? Alternatively, is
> there a better solution for inspecting the ENV of builds which have
> already completed?
> --
> You received this message because you are subscribed to the Google
> Groups "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to [hidden email].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/b5e83af4-9584-4849-8730-85b0bd2191b7%40googlegroups.com
> .


Sent via Migadu.com, world's easiest email hosting

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/30926ba9c23b874445cce0c983b5f5f4cd289915.camel%40barcodeu.com.