Is it possible to Rename or give a custom name to a Build in VSTS?
What I want to do is have my builds named after the version number. The version number is written in a .version
file in the root directory.
The intended name would be: $(MyVersionNumber):$(Rev:rr)
Just create a PowerShell or Bash task and print the new name string to stdout. This script renames the current build to contain the version and source branch name. Since in this case we know that versionNumber is unique (it's being changed on every run to something like 4.109.
Sign in to your organization. From the Projects page, choose actions for the project that you want to rename, and then choose Rename. Edit the name.
You can change your organization name (URL) at any time in Azure DevOps.
Navigate to All > Tools > Pipeline Tools. Select a pipeline tool. In the Pipelines related link, rename the pipeline, and then run Discover.
You can update the build number for current build through Logging Command (e.g. Write-Host "##vso[build.updatebuildnumber]buildnumber"
).
Simple workflow of your code:
$(rev:.r)
in default build number format (Options), for example: $(date:yyyyMMdd)-$(rev:.r)
Build.BuildNumber/BUILD_BUILDNUMBER
).version
fileUnder your build definition you can customize the build name (Build number format):
For example, I added the date variable $(Date:dd.MM.yyyy)
with a specific format to the field Build number format
:
Microsoft Docs, reference article
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With