0
votes

our process looks like this: we are devoloping in a feature branch. Feature branches are merged into develop branch (all via git flow). Merge into master is managed via pull request. A new pipeline job is triggered when master is changed. Build Trigger

The pipeline is uploading a subset of the sources into a storage account. Where we now struggle is, we also want to tag the master branch with a release number (which is part of the uploadprocess and atm stored in a separat json file). Release Format But this is not working, even when handing over an variable to another task. It seams that the checkout and labeling is done before the part of the script runs which defines the variable which should be used fot tagging.

Created ref refs/tags/$(Release) at 3c29791d5ac22fe1b84f42eebe63f7726ac056c3.

Could someone help us :( Thanks.

2
Not get your latest information, is the workaround helpful for you? Or if you have any concern, feel free to share it here.Hugh Lin

2 Answers

0
votes

Why don't you use $(build.buildNumber) to tag?

0
votes

We can not label sources with the customized variable. We can only use the predefined and user defined variables on the variables tab to Label sources.

So as a workaround we can tag with the predefined variable Build.BuildNumber, however you need to create the customer variable $tag as needed, then update the build number with $tag using logging command:

Write-Host ("##vso[build.updatebuildnumber]$tag")

In this way it can pass the value of the $tag to the build number.

Reference this thread: VSTS Label Sources not reading Build Phase Output Variable