When are repositories for jobs/stages pulled in Bamboo

We have a build project that has for jobs in 2 stages.

 

stage 1

 

    checkout source and build  and check in website code   (ie,  build 2.00.00.052 is checked in)

 

2. checkout source and build and check in db migration updates  (ie, migration script folder 2.00.00.052 is checked in

 

deploy stage

 

    pull down the build 2.00.00.052 via nant and deploy to QA web servers

 

2. pull down the repository that holds all migration scripts (ie, 2.00.00.049, .050, .051, and suppose to be new .052)

 

apply the appropriate migration scripts to qa in order (.49, .50, .51 and the supposed to be .052)

 

Our problem is that it appears like the repositories for deploy stage step 2 do not contain the new checked in migration scripts created in stage 1, step 2.

 

Its almost like the repositories are pulled down for all stages, before the stages actually run.

 

Is this a true statement?

how do we force bamboo to pull the repositories just before the job runs like it is configured?

4 answers

Here's what I do that sounds similar to what you want.

I generate an artifact in my build and use deployment plans.  The artifact(s) can contain anything you want since you generate the file.  You could create the file with the build number.  Then your deployment will have that artifact available which you can read programmatically or pass in as an input to a script.

My understanding of the checkout source task across multiple stages in the same plan is that bamboo guarantees each source checkout of the same repo will use the same sha1 (or version).

I would recommend if you need the version of source to be different, then create your second stage as a dependent build plan so that is runs as a separate plan, rather than a second stage in the first plan.

Alternatively, you can add a command or inline script after the sourcecode checkout to run your update to pick up the checkins from the first stage.

 

It looks like even if the second stage is made into a dependency build it still pulls the head version info at the begining of the build chain. I actually have to completely separate the build from the deploy

Heather, thanks for responding,  I dont mind doing that but how do I transfer the build number that we are using from the first build (eg, 2.00.00.052) to the dependent project as a variable deploy.buildnumber?

 

Any thoughts on that?

 

We originally had separate plans but couldnt get the build number from one plan to the other.

Thats what I did.  I pushed the full release number (2.00.00.052) to a buildnumber.txt file, then shared it, did an artifact download on the dependent deploy project and read in the new buildnumber to deploy.

 

Thanks

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,813 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you