When are repositories for jobs/stages pulled in Bamboo

lance_lyons
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 11, 2015

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

1 vote
Alex Soto June 15, 2015

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.

0 votes
lance_lyons
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 15, 2015

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

0 votes
lance_lyons
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 12, 2015

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.

0 votes
Heather Mardis June 12, 2015

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.

 

lance_lyons
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 21, 2015

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events