On Wed, Aug 8, 2018 at 9:26 PM Trevor Howard <
thatr...@gmail.com> wrote:
> update EnvVars post setup but before disposal?
No it is not possible with `SimpleBuildWrapper`. `Context.getEnv` is
called once when the body is entered.
A Pipeline step could define an `EnvironmentExpander` which is
consulted whenever a nested step calls
`StepContext.get(EnvVars.class)`. This would happen, for example, when
a `sh` step starts. Of course that is useless if your step happens to
be something like
sh '''
make world
# two hours later…
aws s3 cp a.out s3://mybucket/binary
'''
since by the time the `aws` binary is run, the token has expired, even
though it was valid when `make` started.
> private static class DisposeEnvironment extends Disposer {
> private static final long serialVersionUID = 1;
> private final Thread thread;
This attempt is in any event impossible as a `Thread` is not `Serializable`.