Closed SA-accesso closed 4 months ago
Hi @SA-accesso
can you explain a bit more in detail what you exactly would like to achieve. What you can do is define the source version (by git commit) so if that helps, the task might be for you.
But getting more details would be useful to better grasp your use case.
Thanks for the quick response!
I have pipeline A and pipeline B. We're versioning our code using a manifest/tagging approach. So what I need to do is have pipeline A read from the manifest to work out what tag to trigger pipeline B from. So Pipeline A renders the manifest, and has the tag ready to pass to pipeline B so that when Pipeline B is triggered - it is using the correct source.
I've tried using the customSourceVersion: refs/tags/Infrastructure-1.0.131565
or Infrastructure-1.0.131565
but it complains with messages like - Error message: Error: The value specified for SourceVersion is not a valid commit ID which I guess is too be expected.
If we can't utilise the extension I'm thinking of passing the tag as a parameter then dynamically defining a repository like:
I ended up getting the ADO REST API to do what I wanted:
- script: |
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(System.AccessToken)" \
-d '{
"definition": { "id": 502 },
"sourceBranch": "refs/tags/$(var)",
"templateParameters": { "environment": "<env>" }
}' \
https://dev.azure.com/accesso-pos-solutions/Commerce/_apis/build/builds?api-version=6.1
displayName: 'Queue build with tag'
env:
your-tag-variable: 'XXXX'
Hi @SA-accesso
ok great. Right now this ain't supported by the task, and as of now, I don't plan on extending the task. But I'm glad you were able to solve it yourself via the API. The task in the end is just a wrapper around the REST API, so for certain things it's actually easier to directly query it.
As you've solved the issue, I'm closing this.
https://marketplace.visualstudio.com/items?itemName=benjhuser.tfs-extensions-build-tasks
Can we use this extension to trigger a build from a tag rather than a branch in ADO?