Yeah, as you found, the environment is the sh is only present during that run. It is just like dropping to a shell (or running another shell within a shell), running some things, and then exiting.
If you want to set them globally, you will need to set them in an environment block in declarative pipeline, or in groovy code. env.FOO = "BAR". If you want to try to set something in the shell, and then get those values back into the pipeline, it gets a little harder. You can return just a value from a shell script and assign that to a variable. Or you can look at the pipeline utility steps plugin to suck things in from a file. On Thursday, November 2, 2017 at 2:07:38 PM UTC-6, itchymuzzle wrote: > > Don't know how to set it globally, most likely someone will know how to do > that and respond. > > > each sh looses it's environment. > > Each sh is it's own environment. If you have two different terminals up, > what you do in one isn't known in the other. For example. > -- 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-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/74cf5bb2-00d5-4d4f-8254-787ea6fb7a78%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.