Is there any way to trigger a pipeline based on a tag on a branch?
currently I'm using :
pipelines:
default:
- step: *build-package
- step: *generate-docs
tags:
v*.*.*:
- step: *build-package
- step: *generate-docs
- step: *publish-docs
To answer my own question, a couple links online suggest that bitbucket does not let you exclude branches so I need to create a dummy branch trigger for master. I haven't had a chance to push anything to master so this is untested but I think it should only trigger a build on master when a tag is pushed. :fingers-crossed:
pipelines:
branches:
'**':
- step: *build-package
- step: *generate-docs
'master':
- step:
script:
- echo "nothing to do for master branch"
tags:
v*.*.*:
- step: *build-package
- step: *generate-docs
- step: *publish-docs
I need this too, because when pushing tags for the staging branch, it does into the pipeline as "production too".
I used Bitrise before, and pipeline on a tag on a specific branch was totally possible. And I need commits to master with tags to trigger the pipeline. But only for master. To staging branch the steps are different.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, you can trigger a pipeline based on a tag on a branch using the "Tags start condition" option in the bitbucket-pipelines.yml file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
can you provide anexample?
pipelines:
branches:
'**':
- step: *build-package
- step: *generate-docs
'master':
tags:
v*.*.*:
- step: *build-package
- step: *generate-docs
- step: *publish-docs
i tried something like this but I don't think you can nest tags under a branch. I really need to specify all branches except master for the first part and then have a separate tags section that applies to any branch
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Would this make sense to exclude master except when tags are pushed to master?
pipelines:
branches:
'[!master]**':
- step: *build-package
- step: *generate-docs
tags:
v*.*.*:
- step: *build-package
- step: *generate-docs
- step: *publish-docs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
An example would be nice, because I need to only trigger the pipeline when on master branch and with tags "*.*.*"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.