azure-devops - 构建管道可视化设计器中某个任务的 YAML 中的注释的目的是什么?

标签 azure-devops azure-pipelines

当我在 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 时可以引用的内容?

最佳答案

这些更像是对用户的一种指令,以了解流程。

例如。:

这里参数( 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)'

关于azure-devops - 构建管道可视化设计器中某个任务的 YAML 中的注释的目的是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53054048/

相关文章:

Azure 构建管道无法检索最新的源版本

azure - 为什么 Azure Devops 管道无法连接到我的 Python/Linux 函数应用程序?

python - 如何从 python 脚本在 azure devops 管道中生成合理的错误消息

azure - 如何设置自动nuget版本增量

git - 使用 Git 触发 CI Build 仅对 VSTS 中的子文件夹进行更改(以前是 TFS Online)

azure-devops - 有没有办法在 VSTS 中撤消管道删除?

Azure DevOps中的Flutter管道

azure-devops - 如何远程桌面 (RDP) 到 Azure Pipelines 的托管代理

azure - 如果我在应用程序网关上启用了防火墙,是否还需要在虚拟网络上启用防火墙?

azure - If/Else 逻辑和自定义变量