Is it possible to log ENV for all pipelines?

9 views
Skip to first unread message

Daniel Schmidt

unread,
Jan 8, 2020, 6:46:41 PM1/8/20
to Jenkins Users
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?

João Pinto

unread,
Jan 11, 2020, 7:19:05 AM1/11/20
to jenkins...@googlegroups.com
Look into shared pipeline libraries (
https://jenkins.io/doc/book/pipeline/shared-libraries/) for having a
common step defined for several pipelines.

João
> --
> 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 jenkinsci-use...@googlegroups.com.
> 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
Reply all
Reply to author
Forward
0 new messages