-
Improvement
-
Resolution: Duplicate
-
Minor
-
LTS 2.150.2
Currently, we can capture the output of a shell step inside of a script block, but have no way to do that in clean declarative pipeline syntax. For example, this post on StackOverflow must instead be:
// Git committer email script { GIT_COMMIT_EMAIL = sh ( script: 'git --no-pager show -s --format=\'%ae\'', returnStdout: true ).trim() } echo "Git committer email: ${GIT_COMMIT_EMAIL}"
It also doesn't work to wrap it in a declarative environment block, though that may perhaps be a reasonable place to extend the syntax.
- duplicates
-
JENKINS-44376 Ability to set variables shared between stages
-
- Open
-
[JENKINS-55771] Assign variable from shell output using declarative pipeline
Description | New: Currently, we can capture the output of a shell step inside of a {{script{}}} block, but have no way to do that in clean declarative pipeline syntax. For example, [this post on StackOverflow|https://stackoverflow.com/a/38783622] must instead |
Component/s | New: workflow-durable-task-step-plugin [ 21715 ] | |
Component/s | Original: pipeline-build-step-plugin [ 21707 ] | |
Component/s | Original: pipeline-stage-step-plugin [ 21709 ] |
Description | Original: Currently, we can capture the output of a shell step inside of a {{script{}}} block, but have no way to do that in clean declarative pipeline syntax. For example, [this post on StackOverflow|https://stackoverflow.com/a/38783622] must instead |
New:
Currently, we can capture the output of a shell step inside of a {{script{}}} block, but have no way to do that in clean declarative pipeline syntax. For example, [this post on StackOverflow|https://stackoverflow.com/a/38783622] must instead be: {code:groovy} // Git committer email script { GIT_COMMIT_EMAIL = sh ( script: 'git --no-pager show -s --format=\'%ae\'', returnStdout: true ).trim() } echo "Git committer email: ${GIT_COMMIT_EMAIL}" {code} |
Component/s | New: pipeline [ 21692 ] |
Description |
Original:
Currently, we can capture the output of a shell step inside of a {{script{}}} block, but have no way to do that in clean declarative pipeline syntax. For example, [this post on StackOverflow|https://stackoverflow.com/a/38783622] must instead be: {code:groovy} // Git committer email script { GIT_COMMIT_EMAIL = sh ( script: 'git --no-pager show -s --format=\'%ae\'', returnStdout: true ).trim() } echo "Git committer email: ${GIT_COMMIT_EMAIL}" {code} |
New:
Currently, we can capture the output of a shell step inside of a {{script}} block, but have no way to do that in clean declarative pipeline syntax. For example, [this post on StackOverflow|https://stackoverflow.com/a/38783622] must instead be: {code:groovy} // Git committer email script { GIT_COMMIT_EMAIL = sh ( script: 'git --no-pager show -s --format=\'%ae\'', returnStdout: true ).trim() } echo "Git committer email: ${GIT_COMMIT_EMAIL}" {code} It also doesn't work to wrap it in a declarative {{environment}} block, though that may perhaps be a reasonable place to extend the syntax. |
Assignee | New: Devin Nusbaum [ dnusbaum ] |
Component/s | New: pipeline-model-definition-plugin [ 21706 ] | |
Component/s | Original: pipeline [ 21692 ] | |
Component/s | Original: workflow-durable-task-step-plugin [ 21715 ] |
Labels | New: pipeline |
Assignee | Original: Devin Nusbaum [ dnusbaum ] |
Link | New: This issue duplicates JENKINS-44376 [ JENKINS-44376 ] |
Resolution | New: Duplicate [ 3 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |