Console output getting hidden when running from library step

13 views
Skip to first unread message

James Telfer

unread,
Feb 4, 2019, 7:16:53 AM2/4/19
to Jenkins Users
Hi,

I'm pulling some common functionality out of my pipelines into a global library.  I've come across the following odd (and unwanted) behaviour;

The original, Declarative Pipeline did something like this:

pipeline {
  ...
  stages {
    stage('Build') {
      steps{
        bat 'call setup-env.bat && run-build.bat'
      }
    }
  }
}

This printed all of the output from both bat files getting executed by that bat step.

However, when I wrapped that in a custom step within the library, I lose all of the output from the second command, although it does execute correctly.  Library function looks like:

def call() {
  bat 'call setup-env.bat && run-build.bat'
}

Anyone any idea as to why it is getting lost?

James Telfer

unread,
Feb 4, 2019, 11:34:10 AM2/4/19
to Jenkins Users
In case anyone else runs into this; the problem was nothing to do with Jenkins, it was a change I'd made to the second script, which hid all output internally.  Coincidence that both changes went in together!
Reply all
Reply to author
Forward
0 new messages