[JIRA] (JENKINS-57454) Declarative Pipeline shares Workspace between builds that are running in parallel

15 views
Skip to first unread message

c.kurrat@gmail.com (JIRA)

unread,
May 14, 2019, 8:04:02 AM5/14/19
to jenkinsc...@googlegroups.com
kurromat created an issue
 
Jenkins / Bug JENKINS-57454
Declarative Pipeline shares Workspace between builds that are running in parallel
Issue Type: Bug Bug
Assignee: Unassigned
Components: core
Created: 2019-05-14 12:03
Environment: Jenkins 2.164.1
Labels: declarative pipeline
Priority: Minor Minor
Reporter: kurromat

When using a Scripted Pipeline, using the node-Block creates a workspace and ensures that the workspace is only used by one build (by appending e.g. @2 )

When using a Declarative Jenkins-Pipeline, this seems not to be the case.

Even when using

agent { node

{ label 'thelabel' }

only one workspace is created, nothing is appended to the workspace-name.

 

Is that inteded behaviour?

I can work around this by using the customWorkspace parameter, but it is a changed behaviour in comparison to the old Jenkinsfiles.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

c.kurrat@gmail.com (JIRA)

unread,
May 14, 2019, 8:04:03 AM5/14/19
to jenkinsc...@googlegroups.com
kurromat updated an issue
Change By: kurromat
When using a Scripted Pipeline, using the node-Block creates a workspace and ensures that the workspace is only used by one build (by appending e.g. @2 )

When using a Declarative Jenkins-Pipeline, this seems not to be the case.

Even when using

 
{code:java}
agent \ { node
{ label 'thelabel' }

{code}
 

only one workspace is created, nothing is appended to the workspace-name.

 

Is that inteded behaviour?

I can work around this by using the customWorkspace parameter, but it is a changed behaviour in comparison to the old Jenkinsfiles.

c.kurrat@gmail.com (JIRA)

unread,
May 14, 2019, 8:05:02 AM5/14/19
to jenkinsc...@googlegroups.com

c.kurrat@gmail.com (JIRA)

unread,
May 14, 2019, 8:08:04 AM5/14/19
to jenkinsc...@googlegroups.com
kurromat updated an issue
When using a Scripted Pipeline, using the node-Block creates a workspace and ensures that the workspace is only used by one build (by appending e.g. @2 )

([https://jenkins.io/doc/pipeline/steps/workflow-durable-task-step/#node-allocate-node] "A workspace is automatically allocated for you with the {{node}} step, or you can get an alternate workspace with this {{ws}} step, but by default the location is chosen automatically. (Something like {{SLAVE_ROOT/workspace/JOB_NAME@2}}.)"

When using a Declarative Jenkins-Pipeline, this seems not to be the case.

Even when using

 
{code:java}
agent {
  node{
    label 'thelabel'
  }

{code}
 

only one workspace is created, nothing is appended to the workspace-name.

 

Is that inteded behaviour?

I can work around this by using the customWorkspace parameter, but it is a changed behaviour in comparison to the old Jenkinsfiles.

c.kurrat@gmail.com (JIRA)

unread,
May 14, 2019, 8:09:04 AM5/14/19
to jenkinsc...@googlegroups.com
kurromat updated an issue
When using a Scripted Pipeline, using the node-Block creates a workspace and ensures that the workspace is only used by one build (by appending e.g. @2 )

( from [https://jenkins.io/doc/pipeline/steps/workflow-durable-task-step/#node-allocate-node]
{noformat}
 "A workspace is automatically allocated for you with the  {{ node }}  step, or you can get an alternate workspace with this  {{ ws }}  step, but by default the location is chosen automatically. (Something like  {{ SLAVE_ROOT/workspace/JOB_NAME@2 }} .)" {noformat}

When using a Declarative Jenkins-Pipeline, this seems not to be the case.

Even when using

 
{code:java}
agent {
  node{
    label 'thelabel'
  }

{code}
 

only one workspace is created, nothing is appended to the workspace-name.

 

Is that inteded behaviour?

I can work around this by using the customWorkspace parameter, but it is a changed behaviour in comparison to the old Jenkinsfiles.

c.kurrat@gmail.com (JIRA)

unread,
May 14, 2019, 8:10:01 AM5/14/19
to jenkinsc...@googlegroups.com
kurromat updated an issue
When using a Scripted Pipeline, using the node-Block creates a workspace and ensures that the workspace is only used by one build (by appending e.g. @2 )

from [https://jenkins.io/doc/pipeline/steps/workflow-durable-task-step/#node-allocate-node]
{
noformat code:java }
 "A workspace is automatically allocated for you with the node step, or you can get an alternate workspace with this ws step, but by default the location is chosen automatically. (Something like SLAVE_ROOT/workspace/JOB_NAME@2.)"{
noformat code }
[https://jenkins.io/doc/pipeline/steps/workflow-durable-task-step/#node-allocate-node] When using a Declarative Jenkins-Pipeline, this seems not to be the case.


Even when using

 
{code:java}
agent {
  node{
    label 'thelabel'
  }

{code}
 

only one workspace is created, nothing is appended to the workspace-name.

 

Is that inteded behaviour?

I can work around this by using the customWorkspace parameter, but it is a changed behaviour in comparison to the old Jenkinsfiles.

c.kurrat@gmail.com (JIRA)

unread,
May 14, 2019, 8:11:01 AM5/14/19
to jenkinsc...@googlegroups.com
kurromat updated an issue
When using a Scripted Pipeline, using the node-Block creates a workspace and ensures that the workspace is only used by one build (by appending e.g. @2 )

from
 [https://jenkins.io/doc/pipeline/steps/workflow-durable-task-step/#node-allocate-node]

{code:java}
 "A workspace is automatically allocated for you with the node step, or you can get an alternate workspace with this ws step, but by default the location is chosen automatically. (Something like SLAVE_ROOT/workspace/JOB_NAME@2.)"{code}
[https://jenkins.io/doc/pipeline/steps/workflow-durable-task-step/#node-allocate-node] When using a Declarative Jenkins-Pipeline, this seems not to be the case.

Even when using

 
{code:java}
agent {
  node{
    label 'thelabel'
  }

{code}
 

only one workspace is created, nothing is appended to the workspace-name.

 

Is that inteded behaviour?

I can work around this by using the customWorkspace parameter, but it is a changed behaviour in comparison to the old Jenkinsfiles.

c.kurrat@gmail.com (JIRA)

unread,
May 14, 2019, 8:11:02 AM5/14/19
to jenkinsc...@googlegroups.com
kurromat updated an issue
When using a Scripted Pipeline, using the node-Block creates a workspace and ensures that the workspace is only used by one build (by appending e.g. @2 )

from [https://jenkins.io/doc/pipeline/steps/workflow-durable-task-step/#node-allocate-node]
{code:java}
 
"A workspace is automatically allocated for you with the node step, or you can get an alternate workspace with this ws step, but by default the location is chosen automatically. (Something like SLAVE_ROOT/workspace/JOB_NAME@2.)"{code}

When using a Declarative Jenkins-Pipeline, this seems not to be the case.

Even when using

 
{code:java}
agent {
  node{
    label 'thelabel'
  }

{code}
 

only one workspace is created, nothing is appended to the workspace-name.

 

Is that inteded behaviour?

I can work around this by using the customWorkspace parameter, but it is a changed behaviour in comparison to the old Jenkinsfiles.
Reply all
Reply to author
Forward
0 new messages