How to get svn version number from checkout for use in dsl

前端 未结 7 1909
南方客
南方客 2021-01-05 03:06

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 simi

7条回答
  •  南方客
    南方客 (楼主)
    2021-01-05 03:30

    this code work for me in jenkins pipeline:

    String url = 'svn+ssh:...'
    SVN_REVISION_IN = sh returnStdout: true, script: 'svn info --show-item last-changed-revision ' + url
    currentBuild.displayName = "Rev: ${SVN_REVISION_IN}"
    

提交回复
热议问题