Используя конвейер JENKINS, я хочу добиться следующего: после моей команды извлечения я хочу получить номер редакции извлечения элемента.
Вот код, который я использую в конвейере:
stage('Checkout') {
steps {
script{
def checkoutResults=checkout changelog: false, poll: false, scm: [$class: 'SubversionSCM', additionalCredentials: [], excludedCommitMessages: '', excludedRegions: '', excludedRevprop: '', excludedUsers: 'jenkins', filterChangelog: false, ignoreDirPropChanges: false, includedRegions: '', locations: [[cancelProcessOnExternalsFail: false, credentialsId: '***********', depthOption: 'infinity', ignoreExternalsOption: false, local: '.', remote: 'svn://tpsa/web/tpo/trunk/${JOB_NAME}']], quietOperation: false, workspaceUpdater: [$class: 'UpdateWithCleanUpdater']]
echo 'checkout results = ' + checkoutResults.toString()
echo 'checkout revision = ' + checkoutResults['SVN_REVISION']
changeAsmVer assemblyCompany: '', assemblyCulture: '', assemblyDescription: '', assemblyFile: '', assemblyProduct: '', assemblyTitle: '', assemblyTrademark: '', regexPattern: '', replacementPattern: '', versionPattern: '1.1.' + checkoutResults['SVN_REVISION'] + '.$BUILD_NUMBER'
}
}
}
Однако в консоли выполнения jenkins: checkoutResults не содержит данных.
Obtained Jenkinsfile from svn svn://tpsa/web/tpo/trunk/CommonLib
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] node
Running on Jenkins in E:\Jenkins\workspace\CommonLib
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Checkout SCM)
[Pipeline] checkout
Reverting E:\Jenkins\workspace\CommonLib\. to depth infinity with ignoreExternals: false
Updating svn://tpsa/web/tpo/trunk/CommonLib at revision '2018-10-19T16:48:09.177 +0200' --quiet
Using sole credentials jenkins/****** in realm ‘<svn://tpsa:3690> GroupeTrace’
At revision 14896
No changes for svn://tpsa/web/tpo/trunk/CommonLib since the previous build
[Pipeline] }
[Pipeline] // stage
[Pipeline] withEnv
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Checkout)
[Pipeline] script
[Pipeline] {
[Pipeline] checkout
Cleaning up E:\Jenkins\workspace\CommonLib\.
Updating svn://tpsa/web/tpo/trunk/CommonLib at revision '2018-10-19T16:48:09.177 +0200'
Using sole credentials jenkins/****** in realm ‘<svn://tpsa:3690> GroupeTrace’
At revision 14896
[Pipeline] echo
checkout results = [:]
[Pipeline] echo
checkout revision = null
Может ли кто-нибудь помочь мне понять, что не так в моем коде?