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

Permit "Execute shell" jobs to return 2 for "unstable"

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Currently, users of "Execute shell" builds must fetch the jenkins-cli jar and execute it in order to mark a build as unstable. For example:

      set -e
      wget ${JENKINS_URL}jnlpJars/jenkins-cli.jar
      make
      if ! make check; then 
        java -jar jenkins-cli.jar set-build-result unstable && exit 0
        exit 1
      fi
      

      will flag as unstable and exit.

      That works, but it's a right pain. The alternative is text-finder plugin string matching, which is arguably worse.

      What'd be ideal is to let the return code 2 mean "unstable" to Jenkins. So one could just replace the above with:

      set -e
      make
      make check || exit 2
      

      I'll see what's involved in adding this, but wanted to put the idea out.

        Attachments

          Issue Links

            Activity

            ringerc Craig Ringer created issue -
            ringerc Craig Ringer made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-23896 [ JENKINS-23896 ]
            ringerc Craig Ringer made changes -
            Labels shell unstable patch pull_request shell unstable
            ringerc Craig Ringer made changes -
            Link This issue is related to JENKINS-23896 [ JENKINS-23896 ]
            ringerc Craig Ringer made changes -
            Link This issue depends on JENKINS-23896 [ JENKINS-23896 ]
            ringerc Craig Ringer made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            ringerc Craig Ringer made changes -
            Status In Progress [ 3 ] Open [ 1 ]
            danielbeck Daniel Beck made changes -
            Link This issue is duplicated by JENKINS-28312 [ JENKINS-28312 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 156576 ] JNJira + In-Review [ 179335 ]
            danielbeck Daniel Beck made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            oleg_nenashev Oleg Nenashev made changes -
            Link This issue is related to JENKINS-39164 [ JENKINS-39164 ]
            jbochenski Jakub Bochenski made changes -
            Link This issue relates to JENKINS-47606 [ JENKINS-47606 ]

              People

              • Assignee:
                Unassigned
                Reporter:
                ringerc Craig Ringer
              • Votes:
                11 Vote for this issue
                Watchers:
                18 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: