tfsazure-devopsazure-pipelinesvnext

VNext optionally label a build?


I am looking to find out if it would be possible to optionally create a label based on a variable decided at build time.

At the moment Label Sources includes 3 options (Never, Always, On Success). I want to add/create a way that it will do it based on a variable.

For example

Label from VSO


Solution

  • It's not possible on the existing UI.

    However you can label source with label command. So, you can try to write script based on your requirements with the label command, then add script manage task (eg: Batch Script, Command Line or PowerShell task) to run the scrip during the building.

    For example to create a label:

    tf label "LabelName" /owner:domain\me $/Project /version:T /recursive
    

    You need to specify the root path of your label.