如何从结帐中获取 svn 版本号以在 dsl 中使用

编程入门 行业动态 更新时间:2024-10-17 21:23:10
本文介绍了如何从结帐中获取 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 checkout.它包含 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 中使用

本文发布于:2023-11-16 11:40:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1603959.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:版本号   svn   dsl

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!