繁体   English   中英

Azure DevOps 管道 - YAML 格式错误?

[英]Azure DevOps Pipeline - YAML formatting error?

有人知道如何解决以下错误吗?

# Starter pipeline
- task: CloudFormationCreateOrUpdateStack@1
  inputs:
    awsCredentials: 'aws_test'
    regionName: 'us-east-1'
    stackName: 'test'
    templateSource: 'url'
    templateUrl: 'https://gist.githubusercontent.com/lizrice/5889f33511aab739d873cb622688317e/raw/c2ba38eb72b350fec28b50df0d8f74b51e1a68e8/vpc-fargate.yaml'
# 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:
- main
pool:
  vmImage: ubuntu-latest
steps:
- script: echo Hello, world!
  displayName: 'Run a one-line script'
- script: |
    echo Add other tasks to build, test, and deploy your project.
    echo See https://aka.ms/yaml
  displayName: 'Run a multi-line script'

我在 azure devops & yaml lint 上遇到的错误

Other Errors
2 error(s), 0 warning(s)
    /azure-pipelines-1.yml (Line: 2, Col: 1): A sequence was not expected
    /azure-pipelines-1.yml: (Line: 13, Col: 1, Idx: 461) - (Line: 13, Col: 1, Idx: 461): While parsing a block collection, did not find expected '-' indicator.

它出现在 YAML Lint 上,当我在第 2 行前面添加 3 个空格时,错误是“已修复”,但 azure devops 仍会为同一行但其他列抛出相关错误。

想知道以前是否有人遇到过这个错误,因为我自己并没有真正输入任何 YAML 代码,而是使用 azure devops 中的编辑器 + 其他 GUI 助手来创建这个

请参阅 YAML 文档。 您在 scope之外有一个有效的task (即文件中的第一件事),该任务在steps下。

YAML 编辑器不保证语法上有效的 YAML。 您最好使用更强大的编辑器,例如带有 Azure Pipelines 扩展的 Visual Studio Code。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM