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

Provide a way to "finish" a Declarative Pipeline successfully but not execute subsequent stages

      pipeline {
      agent any
      environment {

      // 
      buildUser = '';
      }

      tools {

      maven 'M3'
      }
      stages {

      stage('build user') {
      steps {
      wrap([$class: 'BuildUser']) {
      sh 'echo "${BUILD_USER}"'
      script {
      buildUser="${BUILD_USER}";

      //exit sucess does not work
      return;

      }
      }

      }
      }

      }

          [JENKINS-50780] Provide a way to "finish" a Declarative Pipeline successfully but not execute subsequent stages

          Oleg Nenashev added a comment -

          Forwarded to the Pipeline team, because it may be a case for documentation/improvement.
          Note that it's better to ask such questions in the user mailing lists.

          Oleg Nenashev added a comment - Forwarded to the Pipeline team, because it may be a case for documentation/improvement. Note that it's better to ask such questions in the user mailing lists.

          Sam Van Oort added a comment -

          lee I do not understand what you are asking here? Please explain a bit more. Thanks!

          Sam Van Oort added a comment - lee I do not understand what you are asking here? Please explain a bit more. Thanks!

          xian xjr added a comment -
          i want to return turn [sucess] in any stages

          xian xjr added a comment - i want to return turn [sucess]  in any stages

          Andrew Bayer added a comment -

          We don't currently have a good way to achieve this in Declarative. Seems like a reasonable feature request.

          Andrew Bayer added a comment - We don't currently have a good way to achieve this in Declarative. Seems like a reasonable feature request.

            Unassigned Unassigned
            lee xian xjr
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: