アンカー |
---|
| bambooprereqs |
---|
| bambooprereqs |
---|
|
5.1 Installing Bamboo Prerequisite PackagesIf 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 ツール No Format |
---|
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 No Format |
---|
# 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
curl "https://jdk-distros.dev.java.net/source/browse/jdk-distros/trunk/utils/construct.sh?content-type=text/plain&rev=148" > construct.sh
chmod +x construct.sh
./construct.sh unbundle-jdk-6 /opt/jdk-6 /opt/jre-6
./construct.sh unbundle-jdk-5 /opt/jdk-5 /opt/jre-5
|
ant No Format |
---|
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 No Format |
---|
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
|
(optional) Maven 1.1 No Format |
---|
wget "http://archive.apache.org/dist/maven/binaries/maven-1.1.tar.bz2"
tar xjC /opt -f maven-1.1.tar.bz2
|
アンカー |
---|
| customiseinstance |
---|
| customiseinstance |
---|
|
5.2 Adding User Customisations to your InstanceAdding 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 InstanceOnce 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: No Format |
---|
useradd -m bamboo |
After you have created the 'bamboo ' user, you need to download the Bamboo agent elastic assembly. The latest version of the Bamboo agent elastic assembly can be downloaded from the Bamboo download center (choose the desired tab and click 'Show all'). If you need an earlier version of the Bamboo agent elastic assembly, you can download it from the Bamboo Archive Downloads page or for a more complete list, our maven repostiory. Once you have downloaded the Bamboo agent elastic assembly, you need to copy it onto your instance by using the following commands: No Format |
---|
cd <BAMBOO_AGENT_ELASTIC_ASSEMBLY_DOWNLOAD_DIRECTORY>/webapp
scp -i <private_key_file> atlassian-bamboo-agent-elastic-assembly-<x.x.x>.tar.gz 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_DIRECTORY> is your Bamboo Installation directory Navigate to the /mnt directory on your instance and install the artifacts, as described below: Wiki マークアップ |
---|
{htmlcomment}
# *Maven 1.0.2* (patched version)
{noformat}tar xzC /opt -f maven-1.0.2.tar.gz{noformat}
{htmlcomment} |
Bamboo Agent binaries No Format |
---|
tar xzC /opt -f atlassian-bamboo-agent-elastic-assembly-<x.x.x>.tar.gz
ln -s /opt/bamboo-elastic-agent-<x.x.x> /opt/bamboo-elastic-agent
|
where <x.x.x> is the Bamboo version you are running (e.g. 2.4.1) atlassian-bamboo-agent-elastic-assembly-2.3.tar.gz is available in the webapp sub-directory of the Bamboo installation directory. Bamboo Agent default capabilities definition file No Format |
---|
mv bamboo-elastic-agent/bamboo-capabilities.properties /home/bamboo/ |
アンカー |
---|
| ec2enviroment |
---|
| ec2enviroment |
---|
|
5.4 Instance ConfigurationAt 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: No Format |
---|
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: No Format |
---|
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: No Format |
---|
chown -R bamboo:bamboo /home/bamboo/
|
Configure path variables Create a file profile.sh in your instance's /mnt directory. This file contains the default Elastic Bamboo path configuration settings, as seen below: No Format |
---|
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 is correctly customised for your instance, you need to copy it to the /etc/profile.d directory by running the following command on your instance in the /mnt directory: No Format |
---|
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: No Format |
---|
cat /opt/bamboo-elastic-agent/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: No Format |
---|
echo bamboo-<x.x.x> >> /opt/bamboo-elastic-agent/motd
mv /opt/bamboo-elastic-agent/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
|
where <x.x.x> is the Bamboo version you are running (e.g. 2.4.1)
|