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

          xian xjr created issue -
          xian xjr made changes -
          Description New: 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;
           
           }
           }
           
           
           }
           }
           

          }
          xian xjr made changes -
          Issue Type Original: Task [ 3 ] New: Bug [ 1 ]
          Oleg Nenashev made changes -
          Component/s New: pipeline [ 21692 ]
          Component/s New: pipeline-model-definition-plugin [ 21706 ]
          Component/s Original: _unsorted [ 19622 ]
          Oleg Nenashev made changes -
          Assignee Original: Oleg Nenashev [ oleg_nenashev ] New: Andrew Bayer [ abayer ]

          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
          Sam Van Oort made changes -
          Component/s Original: pipeline [ 21692 ]
          Andrew Bayer made changes -
          Issue Type Original: Bug [ 1 ] New: Improvement [ 4 ]

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

              Created:
              Updated: