If you’re interested in versioning your database packages with the new build agent here is an easy way to get started. I started off with the following PowerShell example of a build script from the Visual Studio product groups’ build docs for versioning C# and VB projects and made a few tweaks to update the relevant XML elements of the .sqlproj files.

update .sqlproj file XML attributes: DacVersion, DacDescription
I’ve put the file and the changes into GitHub so you are welcome to use and if you have any improvements to the script just submit a pull request.

update .sqlproj files
Here is the PowerShell script I added as a build step to my Build Definition in VSTS

ApplyVersioningToAssemblies.ps1
The build number format string I’m using is defined on the General tab
$(BuildDefinitionName) $(MajorVersion).$(MinorVersion).$(date:yy)$(DayOfYear)$(rev:.rr)
MajorVersion and MinorVersion are variables defined on the variables tab
Happy Versioning!
No comments yet... Be the first to leave a reply!