本文介绍了如何从结帐中获取SVN版本号以在DSL中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了一个管道作业,并希望获得svn版本号,以在调用Shell脚本时启用进一步的下游处理.我正在使用类似于以下内容的管道脚本:
I created a pipeline job and would like to get the svn version number to enable further downstream processing in a call to a shell script. I am using a pipeline script similar to the following:
node { // Mark the code checkout 'stage'.... stage 'Checkout' // Get some code from a SVM repository checkout( [ $class: 'SubversionSCM', additionalCredentials: [], excludedCommitMessages: '', excludedRegions: '', excludedRevprop: '', excludedUsers: '', filterChangelog: false, ignoreDirPropChanges: false, includedRegions: '', locations: [ [ ... ] ], workspaceUpdater: [$class: 'UpdateUpdater'] ] ) def svnversionnumber=${SVN_VERSION} sh "/.../someshellscript ${svnversionnumber};" }是否存在有关结帐功能的文档?可以获取svn修订版号吗?我可以看到修订已输出到日志.
Is there documentation on the checkout function available? Is it possible to get hold of the svn revision number? I can see that the revision is output to the log.
推荐答案我遇到了同样的问题,但是您可以通过使用调用 SCM结帐.它包含SVN_REVISION的值.
I had the same issue, but you can solve it by using the map that is returned from calling SCM checkout. It contains a value for SVN_REVISION.
// Get some code from a SVM repository def scmVars = checkout( ... ) def svnversionnumber = scmVars.SVN_REVISION更多推荐
如何从结帐中获取SVN版本号以在DSL中使用
发布评论