Details

    • Similar Issues:

      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

          Hide
          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.

          Show
          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

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

              Dates

              • Created:
                Updated:
                Resolved: