Reputation: 276
I'm trying to do a proof of concept to redesign my CI/CD pipelines in Azure Pipelines (formerly known as VSTS). My codebase is in BitBucket.
I need a continuous integration build to be triggered when I push git tags to the remote repo.
The proof of concept works really well when I use Azure Repos (VSTS), it detects a change in the "branch" "refs/tags/current" and triggers the build.
But once I switch to BitBucket, it just doesn't work, no build is triggered.
So my question is:
How can I trigger a CI build in Azure Pipelines (VSTS) when pushing tags to my BitBucket repo?
Thanks!
Upvotes: 3
Views: 2056
Reputation: 5610
I got it to work by doing the following steps (This is using Github, though).
Enter two branch specifications:
- refs/tags/*
- releases/*
PS: These needs to match whereever your repo hosting provider archives releases and tags.
Click Save (not Save & Queue)
Click the "Draft new release"
Enter the details for your release.
Upvotes: 0
Reputation: 30372
No, we cannot achieve that for the service connection endpoints (BitBucket
here) , CI only works when you push commits with new changes (The real file/code changes).
But push git tags only added tags to a commit, no any other new file changes be pushed to the remote repo.
So, if you want to trigger the CI build by pushing tags only, then it will not work...
I can think of is that you can add a insignificant file in source control (a *.txt
file for example). Then edit/modify the file every time when you push tags. After finishing push tags, you need to push the new changes for the *.txt
file, but it will generate a new commit...not the commit you added tags for it...
Upvotes: 3