I am trying to do a deploy when a pull request is merged into the master branch using bitbucket-pipelines however the deploy is not triggered. If I change from pull-requests to branches it does work.
The bitbucket-pipelines.yml look like:
image: 'ruby:2.4.0'
pipelines:
pull-requests:
master:
- step:
name: 'Deploy to production'
deployment: production
caches:
- bundler
script:
- 'bundle install'
definitions:
caches:
bundler: ./vendor
Any help is appreciated.
Hey @Bram van Dooren,
Thanks for reaching out.
Pipelines that are defined for pull requests will run only if there is a pull request open for the branch defined. i.e. in your example above, the pull-requests pipeline will run when a PR is open from the master branch (not when a PR is merged into the master branch).
Branch pipelines run on every push to the branch, so if you'd like your deployment to run when you merge to master, you should define that as a branch pipeline for the master branch. That way, every push to the master branch will trigger the pipeline and the deployment will run.
For more information about pull request pipelines, you can check out our documentation.
Hope this info helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, I ran into this problem as well.
I modified my bitbucket-pipelines .yml this way:
pipelines:
pull-requests:
'**':
- step:
script:
{script code}
My goal is to trigger pipeline, when someone creates PR into master, but this is not working.
I have tried other combinations, but it still didn't work.
Thanks for any help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @nickcub,
Thanks for reaching out. Can you please raise a support ticket so that we can look at your repository in more details?
Thanks,
Aneita
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Bram van Dooren,
I was able to reproduce a similar scenario with my repository when the bitbucket-pipelines.yml file is not in synch between branches.
We opened a bug report for this problem: https://bitbucket.org/site/master/issues/17873/pipelines-yml-file-for-pull-requests.
Let's wait for the outcome of our developers on this, but until there, please try to make all bitbucket-pipelines.yml files in synch across branches and that should fix the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Daniel Santos,
Thank you for your response.
The file bitbucket-pipelines.yml was already in sync across the branches. The issue was as mentioned by @Aneita that I assumed the deployment would be triggered when a pull-request was merged into the master branch.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Bram van Dooren, I didn't understand you correctly. I got that you wanted the pull request merging to master, but didn't get that you wanted the trigger only when the merge was happening. Your write was clear, but I managed to understand the way I wanted =|
I'm glad the @Aneita was able to jump in and clarify this for us. At least I was able to find another issue that needed to be reported.
See you in the next thread!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had a similar issue. It worked before, but suddenly nothing worked (neither pull-request nor merge).
I had to manually trigger the pipeline (from pipelines menu on the right side press "run pipeline", then select the branch and the pipeline you want to run).
Not sure what the problem is and when it will be solved.
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.