Какова цель комментариев в YAML задачи в визуальном конструкторе конвейера сборки? - PullRequest
0 голосов
/ 30 октября 2018

Когда я смотрю в 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 голосов
/ 30 октября 2018

Это скорее своего рода инструкция для пользователей, чтобы понять поток.

например:.

Здесь параметр (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)'
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...