On Mon, May 9, 2016 at 6:28 PM, Andrew Bayer <
andrew...@gmail.com> wrote:
> I'd like to be able to inspect an executed "node" block and see where it
> ran, and then pass that onward to a future "node" block.
def n
node {
// …
n = env.NODE_NAME
}
// …
node(n) {
// now we are on the same node
}
Think twice, maybe three times, before using this trick:
· if the node was a one-shot cloud agent, the second `node` block will
just wait forever for a node of the same name to be reattached
· while you may get the same workspace back, there is no guarantee it
has not been overwritten by a newer build, unless you have disabled
job concurrency
Using `stash`/`unstash` is safer and more general, albeit slower.