Reputation: 1419
I'm hoping people might be kind enough to point me in the right direction with a Bamboo query I have, please.
The company I'm at has an existing Bamboo CI server that's running quite successfully (despite being an old version - 2.6) and I need to set up a new build. The two people who've done almost all of the previous Bamboo work have now left, and so I don't really have anyone internally to turn to for advice.
I was hoping I could describe the manual process, and then have someone suggest the best way to automate this.
Manual process (all on the Windows deployment server):
The batch file itself can be broken down into several steps:
I'm not sure how this best works with our Bamboo server. I started creating a new plan, but when it asked which repository to use (we're using two servers and six repositories) I started to get mightily confused!
If I understand correctly - which I may not - I believe that the normal thing to do would be to do all the building on the Bamboo server and then move files to the right place on the servers, before calling some remote startup command. Is this what I need to do here?
Even if someone can point me to a good guide to Bamboo, I'd be very appreciative. If someone can explain the concepts briefly enough for me to understand what specifically I need to learn to achieve, then that'd be even better!!
Advice much appreciated :)
Upvotes: 3
Views: 10469
Reputation: 6084
If your (or other developers) plan does not support remote agents, a workaround is to use tomcat manager (do harden it, of course):
Upvotes: 0
Reputation: 852
Well, I don't have a lot of experience running Bamboo with Windows, but I'll give this a shot :) Allow me to start by directing you to the Bamboo Administrator's Guide for version 2.6:
https://confluence.atlassian.com/display/BAMBOO026/Bamboo+Administrator%27s+Guide
Check out the section on plans and agents.
With the version of Bamboo you have, a plan consists of basically a script. It can be an Ant script or a Maven script or a batch or bash script. But you only get one. Later versions of Bamboo allow you to run multiple scripts--you should really consider upgrading.
But, if you absolutely can't upgrade, you need to write a single, monolithic script that will run each of those maven tasks, then run the DeployLocal.bat file, and then start up both JBoss instances. (Bamboo handles the source code checkout bit for you.) Then you'll have to configure your plan in Bamboo to run the script.
So, let's talk strategy!
+ Do I build my code on the Bamboo server, and copy it to the remote windows server? Or do I build it on the remote windows server?
First, you should determine if your Bamboo license supports remote agents. Log in to Bamboo and click Administration. Then scroll down to the System menu in the left-hand margin. Click "License Details". Is the value under "Number of remote agents supported" greater than 0?
If so: Yay! You can install a remote agent on the Windows deploy server, and configure your plan to run on that remote agent using capabilities. This means that when you run your plan in Bamboo, all the source code checkouts / building / scripts will be run on the Windows deploy server. You just saved yourself a ton of work!
If not: You will have to build your code on the Bamboo server and then transport it to the deploy server. You'll need to figure out how to do the following things:
How to transport files from your Bamboo server to your Windows server. One thing you might consider is setting up an NFS file share one one server and mounting it on the other. Or setting up an FTP server on either machine.
How to execute commands on the Windows server from your Bamboo server, so you can run the DeployLocal.bat file and start up JBoss. In a Unix environment, this would be fairly easy to do with ssh. In Windows--eh--maybe you should consult some Windows peeps? I have been able to successfully use MobaSSH server to remotely run batch files on Windows machines before, but MobaSSH really only makes sense if your Bamboo machine is Unix.
How to package your code after you build so it can be copied from the Bamboo server to the Windows server. This could be as simple as zipping up the output of your maven build and unzipping it on the Windows server.
How to pull it all together: write a script that will build, package, transport, and unpack your code, then remotely run the DeployLocal.bat and jboss scripts.
+ How can I make my Bamboo plan check out code from multiple repositories?
Unfortunately, Bamboo 3.3 is the first version that allows a job to check out source code out from multiple repositories. You have three options here, ordered from best to worst:
Upgrade to a newer version of Bamboo. Likely to be a painful process, since you are so far behind, but probably worth the effort. Someone's going to have to upgrade it eventually--better now than later.
Cheat with svn:externals. Create a new directory in one of your subversion repositories, and set the svn:externals property on it with references to each of the six repositories that you need Bamboo to check out. Configure Bamboo to check out your new directory--voila, each of those svn repositories will be checked out automatically.
Come up with some other hack for getting around this limitation, such as writing a script that will run the svn client once for each repository.
+ This might take a while to get working.
Yes. You should definitely examine the configurations and scripts for all of the plans your coworkers have already set up--they might have already done all or most of this work for you.
Upvotes: 13