Also, is there a class which we can use, extend or implement which can be run by default for each stage in a Jenkins pipeline(without modifying the pipeline)?
On Mon, Aug 31, 2020 at 8:29 PM Sourabh Jain <sour...@sumologic.com> wrote: > Thanks for a quick response. > > So the context is lost after the job is completed..rgt. > > Thus, running "run.getEnvironment(listener);" does not give all the > environment variables when the job is completed and we try to fetch the > code. > > On Mon, Aug 31, 2020 at 7:49 PM Jesse Glick <jgl...@cloudbees.com> wrote: > >> On Mon, Aug 31, 2020 at 8:44 AM Sourabh Jain <sour...@sumologic.com> >> wrote: >> > How Can I get the Environment Variables that are created in a Jenkins >> Pipeline. >> >> If you mean from within a Pipeline step, you should use >> >> stepContext.get(EnvVars.class) >> >> which will look up variables defined in a particular context. >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Jenkins Developers" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/jenkinsci-dev/CDKvVuClyJk/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> jenkinsci-dev+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr0Z%3DaLD%3DKiLD9WKbUZJ%2BVFHmugy8JEG8DL8Wc-nZrMjvA%40mail.gmail.com >> . >> > > > -- > Best Regards, > *Sourabh Jain* > *8408019626* > Integration Engineer, APP DEV team, > > -- Best Regards, *Sourabh Jain* *8408019626* Integration Engineer, APP DEV team, -- 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 jenkinsci-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CACHaJQQ9D4c1R4dtTpUqSt1jSLqpYxQ-VAk6cEgz7qin0pwkxg%40mail.gmail.com.