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

Storing the shell script execution output in workflow

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Duplicate
    • Component/s: pipeline
    • Labels:
      None
    • Similar Issues:

      Description

      Hi,

      I am using the workflow plugin to organize my builds on jenkins.

      In my script I currently must run many "Shell Script" steps.
      Most of the scripts produce some output that I should catch and use in my further steps.

      Currently I handle this as following:

      sh "xmlstarlet sel -N m=http://maven.apache.org/POM/4.0.0 -t -v \'/m:project/m:version\' pom.xml > .version"
      def ver =  readFile '.version'
      

      But I assume there is a better (undocumented?) way available. Does 'sh' step support more parameters?

      By the way, what does 'sh' step returns? Is it shell script exit code?

      Thank you in advance

        Attachments

          Issue Links

            Activity

            There are no comments yet on this issue.

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                ykryshchuk Yuriy Kryshchuk
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: