It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

bitbucket-pipelines, pull-request vs merge

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?

1 answer

0 votes

Hello Joseph,

For the workflow you're mentioning, you can use branch pipelines.

For example:

pipelines:
branches:
master:
- step:
script:
- # Create zip and deploy to s3.
pull-requests:
feature-branch-*:
- step:
script:
- # 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?

Thanks,

Phil

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,034 views 0 3
Read article

Community Events

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

Events near you