Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Bitbucket Build Number Confusion

Edited

We are currently reading this article and already using Bitbucket Build Number feature. However after reading it again makes us a bit confuse.

 

1. If branch develop BUILD NUMBER value is 30 and we merged it to master and triggers a build in pipeline, then will it become 31?

  • $BITBUCKET_BUILD_NUMBER values will be unique across all branches, meaning you can use it as a software build number that won’t clash with builds on other branches

2. If we rerun a pipeline build in master that is now having 31 as its BUILD NUMBER value, will it become 32?

  • rerunning a build will give it a new build number, also avoiding clashes and helping you track reruns better in the list of completed builds

3. Many said that BUILD NUMBER is equal to the current number of build in pipeline unless you did not do something.

Does rerunning a build pipeline will cause it to not get in synch with what is showing in pipeline tab? If yes, then how to see the current BUILD NUMBER value using cURL or RESTful API?

1 answer

1 accepted

1 vote
Answer accepted
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 21, 2023

Hello @Bitwise DEVS and thank you for reaching out to Community!

Let me go through your questions and address them individually : 

If branch develop BUILD NUMBER value is 30 and we merged it to master and triggers a build in pipeline, then will it become 31?

You're correct, the build number is not tracked based on branches. It's a repository-wide counter that increases every build (doesn't matter to which branch), so each pipeline run will have a unique build number. The variable BITBUCKET_BUILD_NUMBER will be populated with the number of the current build.

If we rerun a pipeline build in master that is now having 31 as its BUILD NUMBER value, will it become 32?

Correct. Each pipeline run will receive a new build number which is +1 to the last pipeline executed in the repository.

 

Many said that BUILD NUMBER is equal to the current number of build in pipeline unless you did not do something.

Does rerunning a build pipeline will cause it to not get in synch with what is showing in pipeline tab? If yes, then how to see the current BUILD NUMBER value using cURL or RESTful API?

The environment variable BITBUCKET_BUILD_NUMBER will always be in sync with what is showing on the pipeline page.

Hope that helps! If you have any follow-up questions feel free to ask.

Thank you, @Bitwise DEVS !

Patrik S

Thank you so much for spending a time answering my questions, really appreciate it!

Like Patrik S likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events