Automated Bamboo server bamboo.cfg.xml configuration
Asked by Scott Burks:

I am working on modeling Bamboo Server in our "Cloud" network using Chef. What I'm looking for that I haven't been able to find is any documentation on if this is possible and if so what needs to be configured. By that I mean which xml files, (i.e., bamboo.cfg.xml). I have the installation automated and I have part of the configuration automated up until the point of the database choice. It seems with me changing the "setupStep" I can get to a certain point but I'm kind of stuck at this point in the configuration of the Bamboo Server. Any help you can give me is greatly appreciated.


Answers:
author: Omar Herrera
body: Hi [@jagannathan](/t5/user/viewprofilepage/user-id/29406) now a days Ansible is the trend tool for achieve this as [@Scott Burks](/t5/user/viewprofilepage/user-id/609928) said.

You can check some [documentation](https://docs.ansible.com) and found a role that adapt to you on this [role repository](https://galaxy.ansible.com/list#/roles?page=1&page_size=10&autocomplete=Bamboo) for bamboo installation.

Cheers.

Omar H.


author: jagannathan
body: HI I'm trying to install bamboo using shell script. I completed till installation part. I got struck into configuring license and external database setup. Is there any possible way to accomplish this?

comments: author: Scott Burks
body: Please see my original response above. The only way I was able to successfully do a fully automated install of Bamboo Server was utilizing Chef cookbooks, recipes, etc.


author: jagannathan
body: Thanks Scott.. If you have any cookbook at chef market, Please share the URL. It will be helpful

Thanks


author: Scott Burks
body: Yeah I was never able to get the key to work when I replaced it with a variable... I could only hardcode it to get it to work...


author: Ramya Kailas
body: Thanks Scott i have done similar to this , except i tried including

?xml version="1.0" encoding="UTF-8"?\>  
\<application-configuration\>  
\<setupStep\>complete\</setupStep\>  
\<setupType\>custom\</setupType\>  
\<buildNumber\>3507\</buildNumber\>  
**\<planName\>CHEF\</**planName**\>**

**\<planKey\>CHEF-JOB**\</planKey**\>**

\<properties\>  
\<property name="bamboo.artifacts.directory"\>${bambooHome}/artifacts\</property\>  
\<property name="bamboo.config.directory"\>${bambooHome}/xml-data/configuration\</property\>  
\<property name="bamboo.jms.broker.client.uri"\>failover:(tcp://\<%= node\['bamboo_server'\]\['server_host'\] %\>:54663?wireFormat.maxInactivityDuration=300000)?maxReconnectAttempts=10\&amp;initialReconnectDelay=15000\</property\>  
\<property name="bamboo.jms.broker.uri"\>tcp://\<%= node\['bamboo_server'\]\['server_host'\] %\>:54663?wireFormat.maxInactivityDuration=300000\</property\>  
\<property name="bamboo.project.directory"\>${bambooHome}/xml-data/builds\</property\>  
\<property name="buildWorkingDir"\>${bambooHome}/xml-data/build-dir\</property\>  
\<property name="daily.backup.dir"\>${bambooHome}/backups\</property\>  
\<property name="hibernate.c3p0.acquire_increment"\>1\</property\>  
\<property name="hibernate.c3p0.idle_test_period"\>100\</property\>  
\<property name="hibernate.c3p0.max_size"\>100\</property\>  
\<property name="hibernate.c3p0.max_statements"\>0\</property\>  
\<property name="hibernate.c3p0.min_size"\>0\</property\>  
\<property name="hibernate.c3p0.timeout"\>30\</property\>  
\<property name="hibernate.connection.SetBigStringTryClob"\>true\</property\>  
\<property name="hibernate.connection.driver_class"\>oracle.jdbc.OracleDriver\</property\>  
\<property name="hibernate.connection.password"\>\<%= node\['bamboo_server'\]\['oracle_admin_db_pass'\] %\>\</property\>  
\<property name="hibernate.connection.url"\>jdbc:oracle:thin:@\<%= node\['bamboo_server'\]\['db_server_host'\] %\>:\<%= node\['bamboo_server'\]\['oracle_port'\] %\>:\<%= node\['bamboo_server'\]\['oracle_sid'\] %\>\</property\>  
\<property name="hibernate.connection.username"\>\<%= node\['bamboo_server'\]\['oracle_admin_db_user'\] %\>\</property\>  
\<property name="hibernate.dialect"\>net.sf.hibernate.dialect.Oracle9Dialect\</property\>  
\<property name="hibernate.setup"\>true\</property\>  
\<property name="license.string"\>BLAH\</property\>  
\<property name="lucene.index.dir"\>${bambooHome}/index\</property\>  
\<property name="serverId"\>BEAZ-1692-QLDZ-UFK4\</property\>  
\<property name="webwork.multipart.saveDir"\>${bambooHome}/temp\</property\>  
\</properties\>  
\</application-configuration\>

When i tried restarting the bamboo server , it didnt work


author: Scott Burks
body: That is exactly correct I modified or customized the bamboo.cfg.xml, checked that into our repo and variablized various values as you can see below:

?xml version="1.0" encoding="UTF-8"?\>

\<application-configuration\>  
\<setupStep\>complete\</setupStep\>  
\<setupType\>custom\</setupType\>  
\<buildNumber\>3507\</buildNumber\>  
\<properties\>  
\<property name="bamboo.artifacts.directory"\>${bambooHome}/artifacts\</property\>  
\<property name="bamboo.config.directory"\>${bambooHome}/xml-data/configuration\</property\>  
\<property name="bamboo.jms.broker.client.uri"\>failover:(tcp://**\<%= node\['bamboo_server'\]\['server_host'\] %\>** :54663?wireFormat.maxInactivityDuration=300000)?maxReconnectAttempts=10\&amp;initialReconnectDelay=15000\</property\>  
\<property name="bamboo.jms.broker.uri"\>tcp://**\<%= node\['bamboo_server'\]\['server_host'\] %\>:** 54663?wireFormat.maxInactivityDuration=300000\</property\>  
\<property name="bamboo.project.directory"\>${bambooHome}/xml-data/builds\</property\>  
\<property name="buildWorkingDir"\>${bambooHome}/xml-data/build-dir\</property\>  
\<property name="daily.backup.dir"\>${bambooHome}/backups\</property\>  
\<property name="hibernate.c3p0.acquire_increment"\>1\</property\>  
\<property name="hibernate.c3p0.idle_test_period"\>100\</property\>  
\<property name="hibernate.c3p0.max_size"\>100\</property\>  
\<property name="hibernate.c3p0.max_statements"\>0\</property\>  
\<property name="hibernate.c3p0.min_size"\>0\</property\>  
\<property name="hibernate.c3p0.timeout"\>30\</property\>  
\<property name="hibernate.connection.SetBigStringTryClob"\>true\</property\>  
\<property name="hibernate.connection.driver_class"\>oracle.jdbc.OracleDriver\</property\>  
\<property name="hibernate.connection.password"\>**\<%= node\['bamboo_server'\]\['oracle_admin_db_pass'\] %\>** \</property\>  
\<property name="hibernate.connection.url"\>jdbc:oracle:thin**:@\<%= node\['bamboo_server'\]\['db_server_host'\] %\>:\<%= node\['bamboo_server'\]\['oracle_port'\] %\>:\<%= node\['bamboo_server'\]\['oracle_sid'\] %\>** \</property\>  
\<property name="hibernate.connection.username**"\>\<%= node\['bamboo_server'\]\['oracle_admin_db_user'\] %\>** \</property\>  
\<property name="hibernate.dialect"\>net.sf.hibernate.dialect.Oracle9Dialect\</property\>  
\<property name="hibernate.setup"\>true\</property\>  
\<property name="license.string"\>BLAH\</property\>  
\<property name="lucene.index.dir"\>${bambooHome}/index\</property\>  
\<property name="serverId"\>BEAZ-1692-QLDZ-UFK4\</property\>  
\<property name="webwork.multipart.saveDir"\>${bambooHome}/temp\</property\>  
\</properties\>  
\</application-configuration\>


author: Scott Burks
body: What I finally ended up doing to get this working in Chef was to do a "standard" installation of Bamboo Server connecting up to an external Oracle database. I did an export or dump of the Oracle database and saved it to a file called expbamboo.dat, for example... I uploaded this expbamboo.dat into our repo for later use. I then did my normal install recipe to lay the Bamboo Server binaries down on the filesystem and then in my instance recipe I did something like the following to import the .dat file once the Oracle database was up and running...

#!/bin/bash

cd \<%= @downloads_dir %\>

/\<%= node\['bamboo_server'\]\['oracle_client_home'\] %\>/bin/imp system/\<%= node\['bamboo_server'\]\['system_db_pass'\] %\>@\<%= node\['bamboo_server'\]\['db_server_host'\] %\>:\<%= node\['bamboo_server'\]\['oracle_port'\] %\>/\<%= node\['bamboo_server'\]\['oracle_service_name'\] %\> file=/\<%= @downloads_dir %\>/expbamboo.dat log=/tmp/impbamboo.log full=Y

Just an FYI... I wrote another cookbook for the complete Oracle installation/configuration J

Once you're done importing the .dat file into your Oracle database you're basically doing the other configuration type stuff laying down .xml, .properties, etc and then restarting the Bamboo Server. The key was capturing the complete Bamboo Server install in that .dat file and then importing it. In that .dat file it captures everything you do, admin password setup, config changes, etc, so once you're done importing the .dat it looks and feels like a completed Bamboo Server.

comments: author: Ramya Kailas
body: So to understand this correctly , the .dat file contains all the info needed for Bamboo setup like Passwords , License info etc.And you have a .xml file that you does the Plan Creation and adding tasks for that Plan. Have you modified the bamboo.cfg.xml to include variables likebamboo.buildKeybamboo.planKey etc Thanks Scott , this is great info


author: Ramya Kailas
body: Hi Scott,I am working on a similar thing , can you share how are you achieving this using Chef.


author: Przemek Bruski
body: If you have the installation automated, Bamboo should do the file handling for you.

Alternatively, you can install Bamboo on your machine, zip the installation directory, home directory, dump the database and use these 3 files to set up an empty Bamboo instance - without setup.

BTW: there are changes coming to setup in 5.0, so any automation is likely to break.


Tags: bamboo-administration