意外的属性路径到发布

时间:2019-02-21 06:12:37

标签: azure-devops

copying files

之后

我正在尝试执行一项任务,以发布复制的文件。

看着the help

我认为我应该可以使用

- task: PublishBuildArtifacts@1
  inputs:
  pathtoPublish: '..\out2'
  displayName: 'Publish Artifact: drop'

但是智能告诉我

unexpected property pathtoPublish

无论如何我尝试保存时都会得到

Could not queue the build because there were validation errors or warnings. /azure-pipelines.yml (Line: 41, Col: 10): Unexpected value '' /azure-pipelines.yml (Line: 42, Col: 3): Unexpected value 'pathtoPublish'

奇怪的是,Intellisense也表明

存在问题
inputs:

错误是

Incorrect type. Expected "object"

Incorrect type

[更新]

Yan建议缩进2个空格会有所帮助,但会引发一些新问题

displayName

[更新]

我更改为

- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '..\out2'
    ArtifactName: drop'

并能够保存YAML 运行时会提示错误

Publishing build artifacts failed with an error: Not found PathtoPublish: C:\Users\kgreed\Downloads\vsts-agent-win-x64-2.147.1\_work\1\out2

1 个答案:

答案 0 :(得分:1)

pathtoPublish应该缩进:

- task: PublishBuildArtifacts@1
  inputs:
    pathtoPublish: '..\out2'
    ArtifactName: drop

示例\阅读:https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/publish-build-artifacts?view=azure-devops