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

IgnoreError step

XMLWordPrintable

      On the issue https://issues.jenkins-ci.org/browse/JENKINS-45579 dnusbaum has added a couple of really nice steps WarnErrorStep and CatchErrorStep, this improvement is a continuation of his work (mostly copy) to add another user case, when you need to ignore the failure of a stage but you want to mar the build as successful and it is not possible to use CatchErrorStep or you want to simplify your stage code, something like the following stage that it is waiting for an input on declarative where you can not use CatchErrorStep for the input, ignoreErrors option would mark the build as SUCCESS and the stage as UNSTABLE.

      stage('Release Candidate') {
        agent any
        options {
          ignoreErrors('Release Candidate was not uploaded')
        }
        input {
          message 'Should we upload the Release Candidate version?'
          ok 'Yes, we should.'
        }
        when {
          beforeAgent true
          beforeInput true
          anyOf {
            tag "rc-\\d+\\.\\d+\\.\\d+*"
          }
        }
        steps {
          echo "My Release Candidate process"
        }
      }
      

            ifernandezcalvo Ivan Fernandez Calvo
            ifernandezcalvo Ivan Fernandez Calvo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: