--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/0cc87af6-82e8-4e17-9398-1fa93e9a684c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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.
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{}.
On Tue, Sep 5, 2017 at 2:14 PM, Craig Silverstein <csil...@khanacademy.org> 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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/0cc87af6-82e8-4e17-9398-1fa93e9a684c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Regards
nirish okram
def extWorkspace = exwsAllocate 'diskpool1'
node ('linux') {
exws (extWorkspace) { sh 'do stuff' }
}
node ('test') {
exws (extWorkspace) { sh 'more stuff' }
}
Two different jobs can also reuse the same workspace, again without stashing, see this example. You will need the run selector plugin for this case.
If you need help to set it up, post your question here, I should be able to help you.
Martin