> every workspace assigned is allowed to contain anything - from other jobs

No, only for the same job.

> Is there a way to request a empty workspace

No, you have to use deleteDir() to be sure.

> that is also deleted after the node{} block completes

No, again, use deleteDir() as the last step in `node` or `ws` (however,
having deleteDir() as first step you don't need this one).

If you don't want to delete the entire workspace, you can use `dir` step to
create a directory inside the workspace (and clean it up by
`dir('dir_name') { deleteDir() }`

BTW, all this information is in the snippet generator help tips (navigate
to http://[JENKINS]/job/[job_name]/pipeline-syntax/).

On Wed, Jun 22, 2016 at 3:13 PM, James Read <xconspiris...@gmail.com> wrote:

> Hi Antonio,
>
> So what I think you're saying, is that every workspace assigned is allowed
> to contain anything - from other jobs, and always deleteDir() should be
> used if a clean environment is needed?
>
> Is there a way to request a empty workspace, that is also deleted after
> the node{} block completes when using the Pipeline plugin?
>
> - James
>
> On Tuesday, 21 June 2016 16:30:22 UTC+1, Antonio Muñiz wrote:
>>
>>
>> On Tue, Jun 21, 2016 at 3:20 PM, James Read <xconsp...@gmail.com> wrote:
>>
>>> It seems that actually the Pipeline makes the whole Jenkinsfile 1x
>>> logical job, and the node{} blocks just allow different node selections
>>> during that job.
>>
>>
>> Not. Every `node` call has its workspace (and it can be erased at any
>> time by Jenkins core, so you never know if the workspace contains what you
>> think). Which means that the Jenkinsfile has to be idempotent and don't
>> rely on workspace contents from previous builds. Actually every node block
>> should remove/put whatever it needs (you can move things from one node to
>> another by using `stash`).
>>
>> If you request for two nodes in the same Jenkinsfile using different
>> labels, you would be using two nodes with two separated workspaces (even in
>> different physical machines!).
>>
>>
>> --
>> Antonio Muñiz
>> Software Engineer
>> CloudBees, Inc.
>>
> --
> 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/77432682-e150-469f-bef9-fc28297ddbb1%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/77432682-e150-469f-bef9-fc28297ddbb1%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Antonio Muñiz
Software Engineer
CloudBees, Inc.

-- 
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/CAJc7kzTExdOqmyGFP8vUu5%2BqWDOg1CxffJxRAv2S%3D2UV2zvtbg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to