-
Improvement
-
Resolution: Duplicate
-
Major
-
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.
- duplicates
-
JENKINS-26133 Shell script taking/returning output/status
-
- Resolved
-
[JENKINS-34331] get shell to expose a value
Description |
Original:
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 achieve, then a dedicated syntax would be required. Some use to dump value in a text file then `readFile` in workflow, this only can be considered a workaround imha, this makes the Pipeline script heavy to read |
New:
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. |
Link |
New:
This issue is related to |
Resolution | New: Duplicate [ 3 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
Link |
Original:
This issue is related to |
Link |
New:
This issue duplicates |
Workflow | Original: JNJira [ 170414 ] | New: JNJira + In-Review [ 198864 ] |
Component/s | New: pipeline-general [ 21692 ] |
Component/s | Original: workflow-plugin [ 18820 ] |