jenkins pipeline checkout svn 获取SVN_REVISION

Love The Way You Lie 2022-09-01 12:58 336阅读 0赞
  1. node()
  2. {
  3. stage('下载代码')
  4. {
  5. 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']])
  6. SVN_REVISION = scmVars.SVN_REVISION
  7. echo "${scmVars}"
  8. echo "${SVN_REVISION}"
  9. }
  10. }

注意remote: SVN_URL 不能写成remote: ‘${SVN_URL}‘,这会导致源码拉取下来后,scmVars里面没有数值

发表评论

表情:
评论列表 (有 0 条评论,336人围观)

还没有评论,来说两句吧...

相关阅读