1

我使用使用 DSL 命令编写的 Jenkins 脚本运行管道。当某个阶段突然出现以下错误时,问题出现了:

Failed to parse D:\newjenkins\jobs\JOB_NAME\builds\166\changelog1.xml

我使用的脚本如下:

pipeline{
   agent none
   parameters{
    ...
   }
    stages('Execution Started'){
    stage('Checkout'){
        parallel{
            stage('Checkout machine1'){
                agent{
                    label "machine1"
                }
                when{
                    beforeAgent true
                    expression { return params.MODULE == 'ALL' || params.MODULE == 'Checkout'}  
                }
                steps{
                    echo "machine1"
                    checkout([$class: 'SubversionSCM', additionalCredentials: [], excludedCommitMessages: '', excludedRegions: '', excludedRevprop: '', excludedUsers: '', filterChangelog: false, ignoreDirPropChanges: false, includedRegions: '', locations: [[credentialsId: '44522e30-239d-4b35-bf11-41f02778026f', depthOption: 'infinity', ignoreExternalsOption: true, local: 'location_checkout_1', remote: 'url_checkout_1'], [credentialsId: '44522e30-239d-4b35-bf11-41f02778026f', depthOption: 'infinity', ignoreExternalsOption: true, local: 'location_checkout', remote: 'url_checkout']], quietOperation: false, workspaceUpdater: [$class: 'CheckoutUpdater']])
                }      
            }
            stage('Checkout machine2'){
                agent{
                    label "machine2"
                }
                when{
                    beforeAgent true
                    expression { return params.MODULE == 'ALL' || params.MODULE == 'Checkout'}  
                }
                steps{
                    echo "machine2"
                    checkout([$class: 'SubversionSCM', additionalCredentials: [], excludedCommitMessages: '', excludedRegions: '', excludedRevprop: '', excludedUsers: '', filterChangelog: false, ignoreDirPropChanges: false, includedRegions: '', locations: [[credentialsId: '44522e30-239d-4b35-bf11-41f02778026f', depthOption: 'infinity', ignoreExternalsOption: true, local: 'location_checkout_1', remote: 'url_checkout_1'], [credentialsId: '44522e30-239d-4b35-bf11-41f02778026f', depthOption: 'infinity', ignoreExternalsOption: true, local: 'location_checkout', remote: 'url_checkout']], quietOperation: false, workspaceUpdater: [$class: 'CheckoutUpdater']])
                }      
            }
            stage('Checkout machine3'){
                agent{
                    label "machine3"
                }
                when{
                    beforeAgent true
                    expression { return params.MODULE == 'ALL' || params.MODULE == 'Checkout'}  
                }
                steps{
                    echo "machine3"
                    checkout([$class: 'SubversionSCM', additionalCredentials: [], excludedCommitMessages: '', excludedRegions: '', excludedRevprop: '', excludedUsers: '', filterChangelog: false, ignoreDirPropChanges: false, includedRegions: '', locations: [[credentialsId: '44522e30-239d-4b35-bf11-41f02778026f', depthOption: 'infinity', ignoreExternalsOption: true, local: 'location_checkout_1', remote: 'url_checkout_1'], [credentialsId: '44522e30-239d-4b35-bf11-41f02778026f', depthOption: 'infinity', ignoreExternalsOption: true, local: 'location_checkout', remote: 'url_checkout']], quietOperation: false, workspaceUpdater: [$class: 'CheckoutUpdater']])
                }      
            }
        }
    }
}
        stage('Build'){
        parallel{
            stage('Build at machine1'){
                agent{
                    label "machine1"
                }
                when{
                    beforeAgent true
                    expression { return params.MODULE == 'ALL' || params.MODULE == 'Checkout' || params.MODULE == 'Build'}  
                }
                steps{
                    echo "machine1"
                    bat 'cd location_machine && ant main '
                }        
            }
            stage('Build at machine2'){
                agent{
                    label "machine2"
                }
                when{
                    beforeAgent true
                    expression { return params.MODULE == 'ALL' || params.MODULE == 'Checkout' || params.MODULE == 'Build'}  
                }
                steps{
                    echo "machine2"
                    bat 'cd location_machine && ant main '
                }        
            }
            stage('Build at machine3'){
                agent{
                    label "machine3"
                }
                when{
                    beforeAgent true
                    expression { return params.MODULE == 'ALL' || params.MODULE == 'Checkout' || params.MODULE == 'Build'}  
                }
                steps{
                    echo "machine3"
                    bat 'cd location_machine && ant main '
                }        
            }
        }           
    }
}

这是我使用的示例脚本。这往往会引发上面突出显示的错误。 詹金斯问题 我主要将检查脚本的模式设置为“尽可能多地更新 svn”,但这并不能解决任何问题。为什么会失败?有哪些可能的方法来避免这个问题?

编辑:我正在使用的管道结帐是:- 签出 groovy 脚本以执行

4

1 回答 1

0

并行 SCM checkout似乎存在围绕此 Exceptions 的未解决问题。很可能问题出在 Jenkins Pipeline 插件本身。我不确定这是否能解决问题,但查看关于打开错误的评论之一,您可以尝试资源锁定

于 2018-03-05T06:26:06.793 回答