Input step breaks out of global library

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      If I have global library in vars/myGlobalLibrary.groovy and inside of that I ask for an input step, the input step breaks out of the method.

      You'll see that the methods right after the def userInput = input are not executed.

      The methods inside my pipeline after the call to the global library are executed so it isn't killing the whole pipeline, just breaking out of the global method release().

      If the call to input is moved back out into the pipeline itself it works just fine and captures the response in the userInput variable.

      Essentially I'm trying to use the global libraries to make my pipeline much shorter and in this case I'm trying to call out to steps like input inside that global var.

      vars/myGlobalLibrary.groovy

      @NonCPS
      def release() {
      
          def userInput = input(
              id: 'userInput', 
              message: 'Proceed with release?', 
              parameters: [
                  [$class: 'TextParameterDefinition', defaultValue: "1.0", description: 'Release Version', name: 'releaseVersion']
              ])
      
      
          echo "never gets here"
      
          echo "releaseversion: " + userInput['releaseversion']
      }
      

      My pipeline stage:

      @Library('pipelinehelper@master') _
          
      deployToProdStage()
      
      def deployToProdStage() {
          stage name:'PROD Deploy',concurrency: 1
      
          myGlobalLibrary.release()
          echo "Makes it here just fine"
      }
      

            Assignee:
            Jesse Glick
            Reporter:
            Kenneth Brooks
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: