Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the purpose of the comments in the YAML of a task in the build pipeline visual designer?

When I look in the YAML for a task in the visual designer of my build pipeline I see comments like

#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

Is this an instruction to me to add the Parameters.projects variable or is it just something that is there for me to refer to should I decide to use the YAML in constructing a YAML build pipeline?

like image 827
Kirsten Avatar asked Oct 29 '18 21:10

Kirsten


People also ask

What is the use of YAML file in Azure DevOps?

YAML build definitions can be added to a project by simply adding their source file to the root of the repository. Azure DevOps also provides default templates for popular project types, as well as a YAML designer to simplify the process of defining build and release tasks.

What is task in YAML?

“ - [Instructor] As I mentioned earlier, tasks are the building blocks of your pipeline. You could think of a task as a package script, a procedure, or command that ultimately produces some kind of an artifact at the end.

What is the file extension which is used to create manual YAML build definition?

The build definition file is a YAML format file (named acquia-pipelines. yaml ) you create in your workspace. The build definition file contains all of the required information to perform the build, including any variables that are required and the instructions used to perform the build.


1 Answers

Those are more a kind of instruction to the users in order to understand the flow.

E.g.:

Here the parameter (parameters.solution) is linked to the value **\*.sln

enter image description here

The YAML for this is

#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)'

Now I'm going to unlink the default value of this variable and point towards my sln file.

enter image description here

If I see the YAML file now the variable Parameters.solution is no longer needed, since the solution is directly assigned to the wcfapp.sln. In this case you will not see any comment in your YAML file

#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)'
like image 181
Jayendran Avatar answered Sep 21 '22 13:09

Jayendran