|

5.1 Installing Bamboo Prerequisite Packages
If you selected ami-e55bbd8c as your base AMI in '2. Selecting an Existing AMI', you can skip this step and go to '5.2 Adding Customisations' as image ami-e55bbd8c has been pre-configured for Bamboo. If you have selected a different AMI, you will need to install the following packages onto your instance using the commands shown below:
- Amazon EC2 API tools
wget http://s3.amazonaws.com/ec2-downloads/ec2-api-tools-1.3-30349.zip
unzip ec2-api-tools-1.3-30349.zip
mv ec2-api-tools-1.3-30349 /usr/local/ec2/ec2-api-tools
|
- Java 6 and Java 5
# get Java 6
wget "http://download.java.net/dlj/binaries/jdk-6u11-dlj-linux-i586.bin"
mkdir unbundle-jdk-6
cd unbundle-jdk-6
sh ../jdk-6u11-dlj-linux-i586.bin --accept-license
cd ..
# get Java 5
wget "http://download.java.net/dlj/binaries/jdk-5.0u17-dlj-linux-i586.bin"
mkdir unbundle-jdk-5
cd unbundle-jdk-5
sh ../jdk-5.0u17-dlj-linux-i586.bin --accept-license
cd ..
# Build the JDKs
wget -O construct.sh "https://jdk-distros.dev.java.net/source/browse/*checkout*
/jdk-distros/trunk/utils/construct.sh?content-type=text%2Fplain&rev=148" --no-check-certificate
sh construct.sh unbundle-jdk-6 /opt/jdk-6 /opt/jre-6
sh construct.sh unbundle-jdk-5 /opt/jdk-5 /opt/jre-5
|
- Ant
wget "http://www.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.bz2"
tar xjC /opt -f apache-ant-1.7.1-bin.tar.bz2
|
- Maven 2
wget "http://www.apache.org/dist/maven/binaries/apache-maven-2.0.10-bin.tar.bz2"
tar xjC /opt -f apache-maven-2.0.10-bin.tar.bz2
mv /opt/apache-maven-2.0.10 /opt/maven-2.0
ln -fs /opt/maven-2.0 /opt/apache-maven-2.0.10
|
- Maven 1.1
wget "http://archive.apache.org/dist/maven/binaries/maven-1.1.tar.bz2"
tar xjC /opt -f maven-1.1.tar.bz2
|
- Maven 1.0
A patched version of Maven 1.0 is also required. This will be installed as part of step '5.3 Deploying Bamboo onto your Instance'.

5.2 Adding User Customisations to your Instance
Adding your own customisations is quite a simple process, once you have made it this far.
To add user customisations to your instance,
- Log into your elastic instance (as previously described in '4. Accessing your Instance').
- Once you have logged into your elastic instance, you can treat it as a standalone machine and install anything you want. For example, if you want to install Tomcat on an Ubuntu instance you would run '
sudo apt-get install tomcat6', configure it, ensure that your startup scripts are in place, etc, just as you would when installing Tomcat on a standalone machine.
Please note however, you cannot customise the operating system of a running instance. If you want to create an instance with a customised operating system (e.g. Ubuntu), you will need to select an AMI with that operating system installed (as previously described in '2. Selecting an Existing AMI').
- Everything that you install will be saved in snapshot image created at the end of these instructions (see '6. Creating an Image of your Customised Instance'). Any instances started from this image will have all of your user customisations automatically installed.

5.3 Deploying Bamboo onto your Instance
Once you have installed the Bamboo pre-requisites on you instance and added your customisations, you can deploy Bamboo onto your instance.
Before you deploy anything however, you need to create a 'bamboo' user on your instance by running the following command:
After you have created the 'bamboo' user, you need to copy the Bamboo artifacts onto your instance by using the following commands:
cd <BAMBOO_STANDALONE_DIRECTORY>/elastic
scp -i <private_key_file> * root@<instance_address>:/mnt |
where <private_key_file> is the private key file generated in '1. Requirements', <instance_address> is the address of your instance from '4. Accessing your Instance' and <BAMBOO_STANDALONE_DIRECTORY> is your Bamboo Installation directory
Navigate to the /mnt directory on your instance and install the artifacts, as described below:
- Maven 1.0.2 (patched version)
tar xzC /opt -f maven-1.0.2.tar.gz |
- Bamboo Agent binaries
tar xzC /opt -f atlassian-bamboo-agent-elastic-assembly-2.3.tar.gz
ln -s bamboo-elastic-agent-2.3 /opt/bamboo-elastic-agent
|
atlassian-bamboo-agent-elastic-assembly-2.3.tar.gz is available in webapp sub-directory of the Bamboo installation directory.
- Bamboo Agent default capabilities definition file
mv bamboo-capabilities.properties /home/bamboo/ |

5.4 Instance Configuration
At this stage, you should have a customised instance with Bamboo deployed onto it. The last step in creating a customised instance is to set up an EC2 environment on your instance. Carry out the following steps to set this up:
- Transfer Amazon private key file and certificate to your instance
Transfer the key files to your instance by running these commands on your local machine:
scp -i <private_key_file> $EC2_PRIVATE_KEY root@<instance_address>:/mnt
scp -i <private_key_file> $EC2_CERT root@<instance_address>:/mnt
|
where <private_key_file> is the private key file from your local machine created in step 'Registered Key Pair' of 1. Requirements and the <instance_address> is the address of your instance from '4. Accessing your Instance'
- Set up EC2_HOME and JAVA_HOME environment variables
Set up these environment variables by running the following commands on your instance:
export EC2_HOME=/usr/local/ec2/ec2-api-tools
export EC2_PRIVATE_KEY=/mnt/<ec2_private_key_file>
export EC2_CERT=/mnt/<ec2_certificate_file>
export JAVA_HOME=/opt/jdk-5
|
- Set appropriate permissions for the bamboo user directory
Run the following command on your instance to set permissions on the bamboo user directory:
chown -R bamboo:bamboo /home/bamboo/
|
- Configure path variables
The profile.sh file should have been transferred to your instance in previous steps. This file contains Bamboo path configuration settings, as seen below:
export JAVA_HOME=/opt/jdk-5
export M2_HOME=/opt/maven-2.0
export MAVEN_HOME=/opt/maven-1.0.2
export ANT_HOME=/opt/apache-ant-1.7.1
export EC2_HOME=/usr/local/ec2/ec2-api-tools
export EC2_PRIVATE_KEY=/root/pk.pem
export EC2_CERT=/root/cert.pem
export PATH=/opt/bamboo-elastic-agent/bin:$EC2_HOME/bin:$JAVA_HOME/bin:$M2_HOME/bin:$MAVEN_HOME/bin:$ANT_HOME/bin:$PATH
|
If all of the tools on this page were installed in recommended locations, no changes are required. Otherwise, you can update the file as required.
Once profile.sh has been updated, you need to copy it to the /etc/profile.d directory by running the following command on your instance in the mnt directory:
mv profile.sh /etc/profile.d/bamboo.sh
|
- Configure automatic startup of the Bamboo agent
You will need to configure your instance to start up the Bamboo agent automatically when the instance is started. You can do this by appending the rc.local file to the one that already exists on your instance, by running the following command on your instance in the mnt directory:
cat rc.local >> /etc/rc.d/rc.local
|
- Final settings and cleanup
Finally, create a Bamboo welcome screen and clean up keys on your instance by running the following command:
echo bamboo-2.3 >> motd
mv motd /etc/motd
rm -f /root/firstlogin /etc/ssh/ssh_host_da_key /etc/ssh/ssh_host_dsa_key.pub
/etc/ssh/ssh_host_key /etc/ssh/ssh_host_key.pub /etc/ssh/ssh_host_rsa_key
/etc/ssh/ssh_host_rsa_key.pub /root/.ssh/authorized_keys
touch /root/firstrun
|
|