构建管道视觉设计器中的任务的YAML中的注释的目的是什么?

时间:2018-10-29 21:24:17

标签: azure-devops

当我在YAML中寻找构建管道的视觉设计器中的任务时,会看到类似的注释

#Your build pipeline references an undefined variable named ‘Parameters.projects’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972

这是给我添加Parameters.projects变量的指示,还是我应该决定在构建YAML构建管道时使用YAML的东西?

1 个答案:

答案 0 :(得分:3)

更多的是给用户一种指导,以了解流程。

例如:

此处参数(parameters.solution)链接到值**\*.sln

enter image description here

YAML为此

#Your build pipeline references an undefined variable named ‘Parameters.solution’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972
#Your build pipeline references the ‘BuildPlatform’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
#Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
steps:
- task: VSBuild@1
  displayName: 'Build solution'
  inputs:
    solution: '$(Parameters.solution)'

    msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\"'

    platform: '$(BuildPlatform)'

    configuration: '$(BuildConfiguration)'

现在,我要取消链接此变量的默认值,并指向我的sln文件。

enter image description here

如果我看到YAML文件,则不再需要变量Parameters.solution,因为解决方案直接分配给了wcfapp.sln在这种情况下,您的YAML文件中将看不到任何评论

#Your build pipeline references the ‘BuildPlatform’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
#Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
steps:
- task: VSBuild@1
  displayName: 'Build solution'
  inputs:
    solution: wcfapp.sln

    msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\"'

    platform: '$(BuildPlatform)'

    configuration: '$(BuildConfiguration)'