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

get shell to expose a value

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Major Major
    • pipeline
    • None

      Pipeline `sh` sometime is used to compute value to be later used by pipeline as a groovy variable. Same happens in a classic shell script, but on can use `foo = $(some command)` in such circumstances. Would be nice to have pipeline support something comparable.

      Not sure something as simple as `def foo = sh 'some command'` can be achieved, then a dedicated syntax would be required.

      Some use to dump value in shell script into a text file, then use `readFile` in Pipeline to parse and assign to a groovy variable, This only can be considered a workaround imho, as this makes the Pipeline script heavy to read.

            jglick Jesse Glick
            ndeloof Nicolas De Loof
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: