Bamboo to Build Specific SVN Revision
Asked Answered
H

2

7

Imagine there's a project in Bamboo with two build plans: Staging Deployment (SD) and Production Deployment (PD). Building SD checks out latest sources, builds them and deploys a web site to a staging server. Currently, PD does all the same, namely deploys the latest version of a web site to a production server. Clearly, this is not very good: I want to be able to deploy the same exact version of a web site that was previously deployed on a staging server, not the latest one.

To illustrate: suppose we're at r101 in SVN repo. Clicking "Build SD" will deploy a web site version, say, 2.1.0.101 to staging server. Now we commit a breaking change and end up at r102. Now I want to deploy to a production server. If I hit "Build PD", Bamboo will happily check out r102 and build it, resulting in version 2.1.0.102 being deployed to a production server.

What I want it to do, however, is to build and deploy a version which was previously built in an SD plan (that is, 2.1.0.101).

Of course I can make SD plan to tag latest-successful build as tags/builds/latest, but I would rather have Bamboo itself handle that.

Handclap answered 26/3, 2010 at 8:3 Comment(0)
H
1

What I ended up doing is tagging each successful staging deployment with a well-known tag (like, `/tags/project-latest') and then building production build from that tag.

Handclap answered 29/3, 2011 at 11:36 Comment(0)
D
5

From your build command, you can specify the revision to use with the option custom.svn.revision.number. So, it'll be something like -Dcustom.svn.revision.number=101 into the PD plan's configuration.

Note: You need Bamboo v1.1 or later for this.

Debug answered 19/7, 2010 at 15:15 Comment(3)
Is there a way to do this without having to enter the revision number manually? Is there a way to "promote" a build from the SD plan and get the PD plan to just find out the specific SVN revision? (maybe when SD plan does a build, log the SVN revision in a build-specific log or manifest file)Fusee
I'm hoping this is no longer the case -- this should be trivial to do from the UI. Will keep looking :-)Quibbling
Missing information about how exactly to specify this. The built-in "Source Code Checkout" task doesn't provide a way to specify the custom revision number, and there's no way to specify -D parameters there. You may wish to edit your answer to elaborate.Ecphonesis
H
1

What I ended up doing is tagging each successful staging deployment with a well-known tag (like, `/tags/project-latest') and then building production build from that tag.

Handclap answered 29/3, 2011 at 11:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.