Skip to content

Instantly share code, notes, and snippets.

@mikeblakeuk
Created September 11, 2019 08:46
Show Gist options
  • Save mikeblakeuk/e94c0748a2b6a401b683e641882b934f to your computer and use it in GitHub Desktop.
Save mikeblakeuk/e94c0748a2b6a401b683e641882b934f to your computer and use it in GitHub Desktop.
How to SemVer using DevOps
variables:
majorMinor: $[ format('{0:yyyy}.{0:M}', pipeline.startTime) ] #or 1.2
buildCounter: $[ counter(format('{0}_{1}', variables['Build.BuildName'], variables['Build.SourceBranchName']), 1) ]
develop_Branch: $[ format('{0}.{1}', variables['majorMinor'] , variables['buildCounter']) ]
preReleaseBranch: $[ format('{0}-{1}', variables['develop_Branch'], variables['Build.SourceBranchName']) ]
semVer: $[ coalesce(variables[format('{0}{1}', variables['Build.SourceBranchName'], '_Branch')], variables['preReleaseBranch']) ]
name: $(semVer)+$(BuildID)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment