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

前端 未结 7 1860
南方客
南方客 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:53

    In Groovy pipeline script it's possible to get results of checkout scm command into TreeMap variable and then get what you need:

    def checkoutResults = checkout([
                poll: false, 
                scm: [
                    $class: 'SubversionSCM', 
                    ...
                ]
            ])
    echo 'checkout results' + checkoutResults.toString()
    echo 'checkout revision' + checkoutResults['SVN_REVISION']
    echo 'checkout revision' + checkoutResults['SVN_REVISION_1']
    echo 'checkout revision' + checkoutResults['SVN_REVISION_2']
    
    0 讨论(0)
提交回复
热议问题