I am trying to use bitbucket-pipelines to test and in a separate step deploy,
When a pull-request is created I want to run unit tests. I see that I can do this with the pull-requests feature.
When the code is merged, I want to create a zip and deploy (copy) code to s3
How do I trigger a step when the code is merged? Not when the pull-request is created.
Do I need to use tags?
For the workflow you're mentioning, you can use branch pipelines.
- # Create zip and deploy to s3.
- # Run unit tests
In this configuration, the zip creation and deployment will only happen when a new commit is introduced to the master branch. i.e. Whenever a feature branch is merged to master.
It is possible to use tags. But that doesn't sound like it's a part of your current workflow, so it isn't necessary to introduce if you don't need them.
Does that work for you?
@Philip Hodder The branch pipeline on `master` isn't really a solution for us, because we can't just run the pipeline willy-nilly on any commit to `master`; we need to know something about how that commit originated. Consider:
When a PR from a `release/*` branch is merged into `master`, I would like to run an action that:
I can't hook this action to any commit to `master`, because a hotfix could come in that gets deployed to `master`, and I wouldn't want that change to trigger the release branch-related workflow.
Hi, Bitbucket community! Are you a DevOps practitioner (or know one in your network)? Do you have DevOps tips, tricks, or learnings you'd like to share with the community? If so, we'd love to hea...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events