• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • workflow-cps-plugin
    • None

      When I tried to parse Maven output (which is running using sh -step), noticed that groovy code only sees first line of output. Example pipeline:

      node() { 
      def outputLog 
      outputLog = sh(script: "ls -la /", returnStdout: true) 
      println outputLog
      //prints full log
      outputLog.eachLine { line, count -> println "$count: $line" }
      //prints only 1 line 
      outputlog = "ls -la /".execute().text outputlog.eachLine { println it }
      //prints all lines 
      }

      So workaround is to use that Groovy's execute.

          [JENKINS-48308] Translate StringGroovyMethods.eachLine

          Juho Saarinen created issue -
          Jesse Glick made changes -
          Component/s New: workflow-cps-plugin [ 21713 ]
          Component/s Original: durable-task-plugin [ 18622 ]
          Summary Original: Pipeline: Nodes and Processes: sh -step's output line changes are not working with groovy New: Translate StringGroovyMethods.eachLine

            Unassigned Unassigned
            hifi Juho Saarinen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: