[JIRA] (JENKINS-57646) Pipeline "when" condition is evaluated on the node

7 views
Skip to first unread message

oren@icx-il.com (JIRA)

unread,
May 23, 2019, 10:20:01 AM5/23/19
to jenkinsc...@googlegroups.com
Oren Shpigel created an issue
 
Jenkins / Bug JENKINS-57646
Pipeline "when" condition is evaluated on the node
Issue Type: Bug Bug
Assignee: Dominik Bartholdi
Components: conditional-buildstep-plugin, pipeline
Created: 2019-05-23 14:19
Environment: Jenkins ver. 2.164.3
Priority: Minor Minor
Reporter: Oren Shpigel

For the following code:

pipeline {
  agent any
  stages {
    stage('Test') {
      agent { label 'nodes' }
      steps {
        sh ''' # code to run tests '''
      }
    }
    stage('Deploy') {
      when {
        branch 'master'
      }
      agent { label 'specific-node' }
      steps {
        sh ''' # code to deploy '''
      }
    }
  }

The "when" condition is being evaluated on 'specific-node' and causes a bottleneck, instead of being evaluated on the master, or on the node that ran the previous stage.

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

trejkaz@trypticon.org (JIRA)

unread,
May 23, 2019, 11:37:02 PM5/23/19
to jenkinsc...@googlegroups.com
trejkaz commented on Bug JENKINS-57646
 
Re: Pipeline "when" condition is evaluated on the node

What if you use `beforeAgent true`?

domi@fortysix.ch (JIRA)

unread,
May 24, 2019, 2:03:02 AM5/24/19
to jenkinsc...@googlegroups.com
Dominik Bartholdi updated an issue
 
Change By: Dominik Bartholdi
Component/s: declarative-pipeline-when-conditions-plugin
Component/s: conditional-buildstep-plugin
Component/s: pipeline

domi@fortysix.ch (JIRA)

unread,
May 24, 2019, 2:03:03 AM5/24/19
to jenkinsc...@googlegroups.com
Dominik Bartholdi assigned an issue to Andrew Bayer
Change By: Dominik Bartholdi
Assignee: Dominik Bartholdi Andrew Bayer
Reply all
Reply to author
Forward
0 new messages