现在,该
sh步骤通过提供参数来支持返回 stdout
returnStdout。
// These should all be performed at the point where you've// checked out your sources on the slave. A 'git' executable// must be available.// Most typical, if you're not cloning into a sub directorygitCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim()// short SHA, possibly better for chat notifications, etc.shortCommit = gitCommit.take(6)
请参阅此示例。



