mountainllka.blogg.se

Pug template increment counter
Pug template increment counter





In the above Write-Host command, we are not printing any values to the output console, instead, we are using the logging command #vso to set the variable buildNumber with our required value.įinally, in the build and publish tasks, I passed the buildNumber to the /p:AssemblyVersion and /p:Version properties respectively. We are trying to achieve a build number in this format - yyyy.mm.dd.revision => 2021.12.26.13 Write-Host "#vso$year.$month.$day.$env:revision" Now, in the PowerShell task, we are going to use this revision to form a build number for our assembly. On each pipeline run, the counter will check for changes in the day number in the pipeline.startTime, and if it's new, the counter will reset to the default value which is 1.Īs of now, we have achieved a revision number that gets incremented on each pipeline run on the same day and also resets to 1 on the next day. This counter function is using startTime of the pipeline in the format of day number as its seed. Name: '$(Build.DefinitionName)_$(SourceBranchName)_$(Year:yyyy).$(Month).$(DayOfMonth).$(revision)'







Pug template increment counter