gpt4 book ai didi

Azure管道: error occurred while loading the YAML build pipeline: wrong number of segments

转载 作者:行者123 更新时间:2023-12-01 23:00:55 24 4
gpt4 key购买 nike

我将 azure-pipelines.yml 从一个项目复制到另一个项目,但它无法构建。我已确保一切都相同,并且两侧都安装了相同的扩展...

旧版本仍然可以运行,但新版本不能:

An error occurred while loading the YAML build pipeline. wrong number of segments

这是 YAML:

# https://aka.ms/yaml
name: $(Build.DefinitionName)_$(GitVersion_InformationalVersion)
pr:
- master
pool:
vmImage: 'VS2017-Win2016'

steps:
- task: gittools.gitversion.gitversion-task.GitVersion@3
displayName: GitVersion

- powershell: .\bootstrap.ps1
displayName: 'Restore pre-requisites'

- powershell: .\build.ps1 -OutputDirectory $(Build.ArtifactStagingDirectory)\$(Build.DefinitionName) -SemVer $(GitVersion.InformationalVersion) -Verbose
displayName: 'Run build script'

- task: richardfennellBM.BM-VSTS-PesterRunner-Task.Pester-Task.Pester@8
displayName: 'Pester Tests'
inputs:
additionalModulePath: '$(Build.ArtifactStagingDirectory)'
CodeCoverageFolder: '$(Build.ArtifactStagingDirectory)'
resultsFile: '$(Common.TestResultsDirectory)\Test-$(Build.DefinitionName)_$(Build.BuildNumber).xml'
CodeCoverageOutputFile: '$(Common.TestResultsDirectory)\Coverage-$(Build.DefinitionName)_$(Build.BuildNumber).xml'

- task: PublishTestResults@2
displayName: 'Publish Test Results'
condition: always()
inputs:
testRunner: NUnit
searchFolder: '$(Common.TestResultsDirectory)'

- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage'
inputs:
summaryFileLocation: '$(Common.TestResultsDirectory)\Coverage-$(Build.DefinitionName)_$(Build.BuildNumber).xml'

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: Module'
inputs:
ArtifactName: Module
PathtoPublish: '$(Build.ArtifactStagingDirectory)'

最佳答案

事实证明,此错误消息表明扩展程序的版本错误。我必须提名该消息为有史以来最没有帮助的消息......

GitVersion 任务(终于!)发布了版本 4,在 Azure Pipeline 世界中,这显然意味着 v3 已被弃用。因此,安装该任务扩展的新团队现在只有 v4 可用(尽管我从中复制 yaml 的团队仍然有 v3)。

解决方案是将第一步更改为:

steps:
- task: gittools.gitversion.gitversion-task.GitVersion@4
displayName: GitVersion

关于Azure管道: error occurred while loading the YAML build pipeline: wrong number of segments,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53235937/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com