Is there currently any way to reset build numbers in Bamboo?
When we move from one build system to another, we want to be able to set the build number to 85 since its currently 84 in the other build system.
Community moderators have prevented the ability to post new answers.
Please do not modify your Bamboo instances database in this way without the help of Atlassian Support as we do not guarentee to any degree that it will work. If you make a mistake changing these numbers there are a number of things that might break and we can't support you.
We believe the management of version numbers is a good feature for Bamboo to have so we have raised a feature request for it. If this is something you would find useful please vote on the issue to let us know :)
EDIT: Ticket to vote for is https://jira.atlassian.com/browse/BAM-10282
James how do I vote on it? What is the feature request number?
Also
I was thinking of creating a global variable that was the build number and then changing that number via db modifications incrementing every build. This doesnt change any of the off the shelf functionality so this could work.
Your suggestion of incrementing the build number in a build script does not persist this build number.
So if we incremented the build number from 6 to 7, where would the 7 be saved so next time we can increment by one to 8?
This is a big issue for us and stopping us from moving forward to using bamboo for all builds.
It seems like bamboo is only setup for CI builds and not total build management.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry Lance, I provided the wrong link!
The idea in that ticket would be to provide a Plan or Global variable that represents your version or schema number and then have a Task that increments that number whenever the build runs.
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.
Use the plugin described at http://blogs.atlassian.com/2012/08/bamboo-maven-version-update-plugin and use this to increment a global variable, and use that as a replacement for the build number. This workaround works fine for our similar issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The approach I said above that came from Atlassian assumes that you delete/ expire all build results first if you want to reset.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Officially.. here is the approach that came from atlassian support
In order to reset build numbers, you need to # delete/expire all existing build results for your specific build # run this SQL query and find the FULL_KEY's related to the build that you want to change:
{code}
select * from build;
{code}
# using the results gathered from the previous query, run this SQL query to make sure that you don't have any build results in the buildresultsummary table (replace 'PROJ1-PLAN1','PROJ1-PLAN1-JOB1','PROJ1-PLAN1-JOB2' with the results from previous query):
{code}
select * from buildresultsummary where build_key in ('PROJ1-PLAN1','PROJ1-PLAN1-JOB1','PROJ1-PLAN1-JOB2');
{code}
# If the previous select returns nothing, means all your build results for that specific build are gone. Shut down your Bamboo server and run this SQL to update the build numbering (replace 'PROJ1-PLAN1','PROJ1-PLAN1-JOB1','PROJ1-PLAN1-JOB2' with your results from original select query):
{code}
update build set FIRST_BUILD_NUMBER=0, LATEST_BUILD_NUMBER=0, NEXT_BUILD_NUMBER=1 where FULL_KEY in ('PROJ1-PLAN1','PROJ1-PLAN1-JOB1','PROJ1-PLAN1-JOB2');
{code}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The above instruction miss one point:
You need also delete all the content from plan_vcs_history where build_key matches plan/jobs you reset build numbers for. If you don't do that change detection won't work properly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I too have just use a perl script with mysql library to directly set the value of the NEXT_BUILD_NUMBER in the database. I know this is not a 'supported' practice, but it works fine, been doing if for several years. Our standard is for the first build number of any new build to be "1001", so if we didn't have a way to set the build number, every build would start with the Bamboo default of '1'.
Here is example for Babmoo 2.5, we haven't moved up to Bamboo 3.3.x, will be doing that in the next few months.
#!/bin/perl
use strict;
use DBI;
my $dbtype = "DBI:mysql";
my $host = "myDBbox";
my $user = "myUSER";
my $password = "myPASSWORD";
my $dbase = "bamboodb";
my $dbh;
my $qhandle;
my %project_to_id;
$dbh = DBI->connect("${dbtype}:${dbase}:${host}",$user,$password);
if (! $dbh) {
die ("database connection failed - $DBI::errstr\n");
}
$qhandle = $dbh -> prepare("update BUILD set NEXT_BUILD_NUMBER=? where BUILDKEY=?") || die "prepare select: $DBI::errstr\n";
$qhandle -> execute($ARGV[0],$ARGV[1]) || die "execute select: $DBI::errstr\n";
$qhandle -> finish();
$dbh->disconnect();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I only edited the NEXT_BUILD_NUMBER (for a particular build) to 1. Then just kicked off the build.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just tried to set the NEXT_BUILD_NUMBER to 1 and the build would not start. Appears to be some invisible constraints that are checked.
I had 4 distinct apps that I need to tie to the same build number
app 1 was at build 5
app 2 was at 32
app3 was at 14
app 4 was at 9
I set the next_build_number to 35 and I was ok. I dont see how you can set it to 1 unless you also set the related unknown other area to 1 as well. I think there are logs, etc that are tied to this build number
This is a crappy design that does not let us manage the build number. The build number should be for the customer to control and not some form of identity column in a database for Atlassian.
All build systems except Bamboo allow this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Although not our normal practice, I have had to reset build numbers. The workaround is to directly edit the database which is rather simple to do.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ron, I tried that with the latest_build_number and next_build_number in the build table and that didnt work.
How do you do this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lance,
Its not possible to reset the Bamboo build number. You would have to indepentently manage this number yourself (such as incrementing the number in a build script instead of relying on the build number from Bamboo).
Thanks
James
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
can I create a build number global variable in Bamboo and increment that one from within a script? We would need to have a way to remember the last build number for sure.
We are able to reset buildnumbers in Teamcity which is what we currently have. We are moving to Jira, Confluence and perhaps Bamboo if it will work for us.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
also we have several applications that we build that we would like to have at the same build number.
Another good reason is when you change your major, minor (release number) you might want to reset the build number to 1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.