Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

trigger merge of bitbucket branch from bamboo build plan stage Edited

A Bamboo Build Plan has several stages.  Each of the stages is triggered by a specific branch of a linked remote Bitbucket repository.  After the stage of the Bamboo build plan completes successfully, the linked Bamboo deployment environment tasks are triggered. 

What specifically do I need to do in order to get the completed deployment environment tasks in Bamboo to trigger a merge of the remote Bitbucket repository code to the next highest branch? 

If a merge to the next highest branch in the remote Bitbucket can be triggered from Bamboo at the end of the deployment environment tasks, then that would trigger the running of the next stage of the Bamboo build plan. So that the Bamboo build plan pipeline could continue. 

Surely this functionality has been developed and tested, because this auto-merging to the next highest level is an essential enabling technology for a continuous delivery pipeline.

 

2 answers

0 votes

Hi Username,

Did you try this variable to print the branch name of the linked repository

${bamboo.planRepository.<position>.branchName}

as described in the default variables page?

where position is the name of the branch in the repository

if your intention is to just print the repository URL, this might help.

${bamboo.planRepository.<position>.repositoryUrl}

Otherwise what error do you get when you use it?

If a developer already knows the value of the <position> variable, then the user already knows the information required to successfully merge.  The question above assumes that the developer does NOT know the value of the <position> variable.  The solution to this problem seems to involve using raw git commands because the Bitbucket layer does not seem to model this.  Also note that the merging is being done from a remote git repo on the build server to a central git repo on the Bitbucket server.  Your answer does not address these aspects.

Jeyanthan I Atlassian Team Apr 03, 2018

For your use case, is it possible for you to utilise one of the bamboo's automatic merge strategies to do the merge instead of relying on automatic merge in Bitbucket?

You will see why your suggestion would not apply if you re-read the first paragraph of the question above. 

    "A Bamboo Build Plan has several stages.  Each of the stages is triggered by a specific branch of a linked remote Bitbucket repository.  After the stage of the Bamboo build plan completes successfully, the linked Bamboo deployment environment tasks are triggered."

As you can read in the first paragraph, this implementation needs a release pipeline, and the Build Plan Stages are being used to implement the release pipeline.  In the past, we did examine plan branching, but none of the Atlassian documentation indicated that a pipeline could be created using plan branching.  The only logical way to organize a pipeline using the objects available in Bamboo seems to be to utilize Plan Stages as the model for Pipeline Stages, and to have success at each Plan Stage trigger deployment to a specified environment. 

At the moment, we are focusing on raw git commands and the Bitbucket REST API. 

If you can show how to implement a release pipeline with clear stages using plan branching, for the use case described in this question, then it would make sense to explore automatic merging strategies again in more detail.

0 votes
Foong Atlassian Team Apr 10, 2018

Please try using this REST API to trigger Pull Request Merge.

Since it require Pull Request ID, please use the workaround in this feature request:

https://jira.atlassian.com/browse/BAM-18350 (replace bamboo_repository_revision_number with bamboo_planRepository_revision for deployment)

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 101 Video

G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...

179 views 4 6
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