Thanks for that link -- that was very helpful!
Here's a snippet from it:
```
EDIT: As pointed out by @amuniz, you have to stash/unstash the contents of
the workspace, as different nodes respectively workspace directories might
be allocated for the two node steps.
```
so that's another approach to take.
craig
On Tuesday, September 5, 2017 at 1:21:27 PM UTC-7, ok999 wrote:
>
> i have ran into this in the past, but we manage to solve this by assigning
> a workspace for each build. there is a dsl - ws().
>
> Another thing regarding the executor while waiting for user input, use the
> input(), outside of node{}.
>
>
> https://stackoverflow.com/questions/37831386/jenkins-pipeline-input-step-blocks-executor
>
>
>
>
>
>
> On Tue, Sep 5, 2017 at 2:14 PM, Craig Silverstein <[email protected]
> <javascript:>> wrote:
>
>> I have a jenkins pipeline script that does something like this:
>> ```
>> node('master') { do_stuff(params.FOO); }
>> prompt "Look good?"
>> node('master') { do_more_stuff(); }
>> ```
>>
>> `do_more_stuff()` depends on workspace-changes made by `do_stuff()`
>> (files created, repos synced, etc).
>>
>> This worked fine when only one job could run at a time, but we recently
>> changed it so you could run two jobs concurrently, and now have a problem
>> that a single job could use different workspaces for `do_stuff` and
>> `do_more_stuff`. That is, job A could use workspace@1 for do_stuff but
>> workspace@2 for do_more_stuff, if job B was using workspace@1 at the time.
>> This causes the job to behave badly since the workspace isn't set up
>> properly for `do_more_stuff`.
>>
>> I could solve this by doing
>> ```
>> nost('master') {
>> do_stuff(...);
>> prompt ...
>> do_more_stuff(...);
>> }
>> ```
>> but I'm trying to free up the executor while waiting for the prompt to be
>> executed (it could be a while).
>>
>> Are there any other ways to solve this problem? What are the best
>> practices here? I feel I must be missing something in how `node` is
>> supposed to be used.
>>
>> craig
>>
>> --
>> 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 [email protected] <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-users/0cc87af6-82e8-4e17-9398-1fa93e9a684c%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/jenkinsci-users/0cc87af6-82e8-4e17-9398-1fa93e9a684c%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Regards
> nirish okram
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/72328768-8e33-47c0-9cf0-d1c9d20223bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.