When configuring a buildnumber format like this $(date:yyyyMMdd)$(rev:.r) in a build-definition and use this also in a Variable BUILD_BUILDNUMBER $(rev:.r) This value (BUILD_BUILDNUMBER) is not expanded like in the past.
To repro this just define a new build-def With a variable BUILD_BUILDNUMBER value $(rev:.r) run the commandline task "set" as the only task in that build-definition.
I get different results on different buildagentOS and private and hosted agents
bad results on:
Private MacOS AGENT_VERSION=2.124.0 (MAC OS 10.10)
Hosted macOS AGENT_VERSION=2.140.0
Hosted Vs2017 AGENT_VERSION=2.140.0
I get good results on the agents below
Windows private agent AGENT_VERSION=2.131.0
Hosted Ubuntu 1604 AGENT_VERSION=2.140.0 Private RHEL
example of a bad result is
BUILD_BUILDNUMBER='$(rev:.r)'
example of a good result is
BUILD_BUILDNUMBER=20180928.5
When this functionality is not stable we can not trust this function for our build-numbers.
@ronaldheinen in the future you might want to report this kind of issue to developer community instead of the agent repository since the Build Number function is not part of the agent. :D
I will help you forward this issue to people who should be able to help your problem.
BUILD_BUILDNUMBER is a predefined variable. If you create a definition variable with this name, any tasks that reference it will get this variable's value and not the system-defined value.
Also, $(rev:.r) is a special variable format that _only_ works in the Build Number field in the editor.
If you create an item here on the Azure DevOps Developer Community site with more details on what it is you're trying to accomplish I will be happy to assist.
Edit: if you're looking to create a counter variable, you can do so with the counter() expression. See this documentation for details. It's yaml-centric but will work in the editor as well.
Most helpful comment
BUILD_BUILDNUMBERis a predefined variable. If you create a definition variable with this name, any tasks that reference it will get this variable's value and not the system-defined value.Also,
$(rev:.r)is a special variable format that _only_ works in the Build Number field in the editor.If you create an item here on the Azure DevOps Developer Community site with more details on what it is you're trying to accomplish I will be happy to assist.
Edit: if you're looking to create a counter variable, you can do so with the
counter()expression. See this documentation for details. It's yaml-centric but will work in the editor as well.