jenkins pipeline checkout svn 获取SVN_REVISION
node()
{
stage('下载代码')
{
scmVars = checkout([$class: 'SubversionSCM', additionalCredentials: [], excludedCommitMessages: '', excludedRegions: '', excludedRevprop: '', excludedUsers: '', filterChangelog: false, ignoreDirPropChanges: false, includedRegions: '', locations: [[cancelProcessOnExternalsFail: true, credentialsId: '870f0549-bf20-4eee-9509-a6afc948adz9', depthOption: 'infinity', ignoreExternalsOption: true, local: '.', remote: SVN_URL]], quietOperation: true, workspaceUpdater: [$class: 'UpdateUpdater']])
SVN_REVISION = scmVars.SVN_REVISION
echo "${scmVars}"
echo "${SVN_REVISION}"
}
}
注意remote: SVN_URL 不能写成remote: ‘${SVN_URL}‘,这会导致源码拉取下来后,scmVars里面没有数值
还没有评论,来说两句吧...