Azure-pipelines-agent: Using YAML build definition, have the ability to set build number format

Created on 5 Jul 2018  路  6Comments  路  Source: microsoft/azure-pipelines-agent

Agent Version and Platform

Hosted VS2017 Windows. But I suspect that this request is for every agent type.

VSTS Type and Version

VisualStudio.com

Issue

While creating the build definition manually, I have an option to set build number format using Option tab:
image

Currently, in YAML build definition, I'm not able to set that. Also after the build definition is created, I'm unable to manually set that option (Options tab is gone if I'm using YAML ).
My question is: is it possible to achieve this right now?

Most helpful comment

My understanding is that setting the following at the top of your yaml file achieves that:

name: $(Build.DefinitionName)-$(date:yyyyMMdd)$(rev:.r)

See https://github.com/Microsoft/vsts-agent/blob/master/docs/preview/yamlgettingstarted-name.md

This then populates Build.BuildNumber

All 6 comments

My understanding is that setting the following at the top of your yaml file achieves that:

name: $(Build.DefinitionName)-$(date:yyyyMMdd)$(rev:.r)

See https://github.com/Microsoft/vsts-agent/blob/master/docs/preview/yamlgettingstarted-name.md

This then populates Build.BuildNumber

@simonvane yes that did the trick. thank you for your quick response!

@simonvane the link no longer works:(

@simonvane Thanks man! It really helped me!

Was this page helpful?
0 / 5 - 0 ratings