首页 > 解决方案 > Jenkins 管道文件中的并行 MSBuild 失败

问题描述

我注意到,每当我尝试在 jenkins 文件中构建脚本化的 .NET 解决方案时,在不同的节点上并行构建,其中一个构建成功,但其他构建失败。我的设置如下:

    "Pipeline A": {
                node {

                stage('Git clone') {
                    checkout scm
                }

                stage('Build') {

                    powershell '".paket\\paket.bootstrapper.exe"'    
                    powershell '".\\paket_install.bat"'
                    bat '"msbuild" iGCAutomation.sln"'
                }

                },
                "Pipeline B": {
                node {      

                    stage('Git clone') {

                        checkout scm
                    }

                    stage('Build') {

                        powershell '".paket\\paket.bootstrapper.exe"'    
                        powershell '".\\paket_install.bat"'
                        bat '"msbuild" iGCAutomation.sln"'

                    }       

你明白我的意思。

在日志中,我确实看到了这个建议,我尝试过但实际上并没有奏效。

一次在此解决方案中构建项目。要启用并行构建,请添加“/m”开关。

因此对于流水线 A,paket 下载必要的依赖项并继续执行其他阶段。在管道 B 中,构建失败。

知道为什么会这样吗?

标签: parallel-processingmsbuildjenkins-pipeline

解决方案


推荐阅读