I am setting our build/release environment using TFS 2017.
I set up the Build to run automatically after each commit, and when we are ready to release a version of our application, a Release is manually created, and then deployed to various environments.
We would like to tag released versions in our git repository in order to easily know which git revision correspond to a binary. The "Label Source" setting in the Build definition allows to tag a git revision at build time, but since we build on every commit that would generate a lot of tags which we don't care about (as they are not deployed anywhere until a release is made).
How can TFS be setup so that when a Release is created (or possibly, deployed to an environment), a tag is created on the corresponding commit in our Git repository?
$(BUILD.SOURCEVERSION)
variable, so I can assign the new tag to that revision. Here's the PS command that I used:Invoke-RestMethod $uri -Method Post -Body (ConvertTo-Json $body) -Credential $cred -ContentType "application/json"
And thename
property in the body should be set to something like:"refs/tags/v_0.9.234.2"
– Catafalque