Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-52348

Windows bat steps never fail

    XMLWordPrintable

Details

    Description

      bat steps in Jenkins never fail:

       


      pipeline
      {
      agent any

      stages
      {
      stage('Build')
      {
      steps

      { bat returnStatus: true, script: ''' EXIT 1 ''' }

      }
      }
      }


       

      (Formatting above is scrambled by Jira)

       

      ... results in:


      [Jenkins Test-Pipeline] Running batch script

      C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>EXIT 1
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      Finished: SUCCESS

      Attachments

        Activity

          This is expected behavior, read documentation on returnStatus parameter:

           

          Normally, a script which exits with a nonzero status code will cause the step to fail with an exception. If this option is checked, the return value of the step will instead be the status code.

          slonopotamusorama Marat Radchenko added a comment - This is expected behavior, read documentation on returnStatus parameter :   Normally, a script which exits with a nonzero status code will cause the step to fail with an exception. If this option is checked, the return value of the step will instead be the status code.

          People

            Unassigned Unassigned
            settrend A. D.
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: