我正在学习Azure DevOps管道。我在YAML文件中遇到错误,无法修复它。有人可以帮我吗?
下面是错误:
():在此上下文中,第3行第11列不允许使用映射值
我一直在使用www.yamllint.com/进行修复,但是没有运气。(task:PowerShell@2
默认情况下,代码的一部分是通过Azure DevOps的“任务”选项添加的)。
# Starter pipeline
- task:PowerShell@2
inputs:
filePath:'$(System.DefaultWorkingDirectory)/_learndevops/HelloWorld.ps1'
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
- task:PublishBuildArtifacts@1
inputs:
PathtoPublish:'$(Build.ArtifactStagingDirectory)'
ArtifactName:'drop'
publishLocation:'Container'
# https://aka.ms/yaml
trigger:
- master
pool:
vmImage:'ubuntu-latest'
steps:
- script:echo Hello, world!
您应该将任务放在以下位置steps
:
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- master
pool:
vmImage:'ubuntu-latest'
steps:
- script: echo Hello, world!
- task: PowerShell@2
inputs:
filePath: '$(System.DefaultWorkingDirectory)/_learndevops/HelloWorld.ps1'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
我还修复了缩进,请将我的yaml与您的yaml进行比较,以准确了解我的所作所为。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句