This page last changed on Jun 22, 2011 by smaddox.


You are embarking on stage 7 of the Atlassian Dragon Quest. The dragon may be growing in strength and power, but so are you.

In this stage, you will install Atlassian Bamboo for continuous integration. Then you will get Bamboo talking to JIRA and run your first Bamboo build.

Time estimate: This stage will take approximately 60 minutes.

On this page:

Step 1. Create your Bamboo Database in PostgreSQL

Now you will create a database where Bamboo will store its data, and the user that Bamboo will use to connect to the database. We are assuming that you have already created your PostgreSQL database server in Dragons Stage 1.

We are using pgAdmin III, the administration user interface supplied with PostgreSQL. If you used the one-click installer in Dragons Stage 1, pgAdmin III will be already installed on your computer.

  1. Start pgAdmin III.
  2. Add a new login role called 'bamuser':
    • Right-click 'Login Roles' and select 'New Login Role'.
    • Enter the role 'Role name': bamuser.
    • Enter a 'Password' and enter it again to confirm it.
    • Click the 'Role privileges' tab.
    • Select 'Can create database objects'.
    • Select 'Can create roles'.
    • Click 'OK' to create the user.
  3. Add a new database called 'bamboo':
    • Right-click 'Databases' and select 'New Database'.
    • Enter the database 'Name': bamboo.
    • Select the 'Owner': bamuser.
    • Click 'OK' to create the database.

Alternatively, If you are on UNIX and do not have pgAdmin III, you can use the command line interface instead. Assuming that you are using the default installation directory of /opt/PostgreSQL/8.3/bin/, enter the following commands:

sudo -s -H -u postgres
# Create the Bamboo user:
/opt/PostgreSQL/8.4/bin/createuser -S -d -r -P -E bamuser
# Create the Bamboo database:
/opt/PostgreSQL/8.4/bin/createdb --owner bamuser --encoding utf8 bamboo
exit

Screenshot 1 (click to enlarge): Bamboo database and user in PostgreSQL

Step 2. Install Bamboo

Requirements: Bamboo 3.1.3.

For Windows: (click to expand)
  1. Go to the Atlassian download centre.
  2. Download the 'Standalone (Windows Installer)' file for Bamboo 3.1.3.
    Please use the Bamboo version specified in this documentation. If the download centre shows a Bamboo version later than 3.1.3, click 'downloads archive' and get Bamboo 3.1.3.
    Why? We have tested the integration suite with this version. There is a chance that you will have problems integrating the other applications if you use a different version.
  3. Run the Bamboo Windows installer (atlassian-bamboo-3.1.3-standalone-windows-x32.exe or atlassian-bamboo-3.1.3-standalone-windows-x64.exe).
    • When prompted, enter the 'folder where you would like Bamboo to be installed'. For example: C:\Program Files\Bamboo or C:\atlassian\bamboo.
      From this point onwards, we will refer to this installation directory as {BAMBOO_INSTALL}.
    • When prompted, tell Bamboo where to put its 'Bamboo home' directory. For example: C:\data\bamboo-home.
  4. Click 'Finish' to close the setup window when the installer has finished.
  5. Because Bamboo will be running on the same machine as JIRA, you need to ensure that the URL paths are different for Bamboo and JIRA. Change the default Bamboo path as follows:
    • Edit the wrapper.conf file in your {BAMBOO_INSTALL}\conf folder.
    • Find the following line:
      wrapper.app.parameter.4=/

      and replace it with the following line:

      wrapper.app.parameter.4=/bamboo
    • Save the file.
  6. Start your Bamboo server by running {BAMBOO_INSTALL\BambooConsole.bat. If you are running Bamboo in Windows Vista or Windows 7, you may need to run this file in administrative mode by right clicking it and selecting 'Run as administrator'.
For UNIX or Linux: (click to expand)
  1. Go to the Atlassian download centre.
  2. Click the 'Linux' tab and download the 'Standalone (TAR.GZ Archive)' file for Bamboo 3.1.3.
    Please use the Bamboo version specified in this documentation. If the download centre shows a Bamboo version later than 3.1.3, click 'downloads archive' and get Bamboo 3.1.3.
    Why? We have tested the integration suite with this version. There is a chance that you will have problems integrating the other applications if you use a different version.
  3. Unpack the tar.gz archive into a directory of your choice, avoiding spaces in the directory name.
  4. Tell Bamboo where to put its Bamboo Home directory:
    • Edit the properties file at {BAMBOO_INSTALL}/webapp/WEB-INF/classes/bamboo-init.properties.
    • Insert the property 'bamboo.home' with an absolute path to your Bamboo Home directory. For example:
      bamboo.home=/var/bamboo-home
    • Save the file.
  5. Because Bamboo will be running on the same machine as JIRA, you need to ensure that the URL paths are different for Bamboo and JIRA. Change the default Bamboo path as follows:
    • Edit the wrapper.conf file in your {BAMBOO_INSTALL}/conf/ folder.
    • Find the following line:
      wrapper.app.parameter.4=/

      and replace it with the following line:

      wrapper.app.parameter.4=/bamboo
    • Save the file.
  6. Start your Bamboo server by running {BAMBOO_INSTALL}/bamboo.sh start.

Problems? Please raise a support ticket for the product you're stuck on, see answers from the community, or search the forum of past dragon slayers.
Victory? Please continue.

Step 3. Set Up Bamboo

Now you can run Bamboo's Setup Wizard and then check your default Bamboo capabilities.

The instructions below assume that you already have a build tool set up. You can use any of the build tools supported by Bamboo, such as Maven 1, Maven 2, Ant, PHPUnit and others. Bamboo calls them 'executables'. See the Bamboo documentation. For this integration exercise, we assume that you are using Maven 2.

  1. Set up your Maven 2 environment:
    • If you do not yet have Maven 2 installed, we recommend that you download and install the Atlassian Plugin SDK. Note that you do not need to configure an IDE. The SDK includes Maven 2 and a correctly-configured Maven settings.xml file, as well as a number of shell scripts to speed up and simplify plugin development. It also includes the Java Activation and other JARs that you will need for a successful Maven build.
    • If you already have Maven 2, please ensure that you have the required additional JARs. See the FAQ for information on downloading these JARs.
  2. To access Bamboo, go to your web browser and type this address: http://localhost:8085/bamboo.
  3. The Bamboo Setup Wizard will start, to guide you through the process of setting up your Bamboo server and creating an administration user.
    • Enter your license key. If you do not already have a Bamboo license, follow the prompts on the Setup Wizard screen to get an evaluation license key.
    • Choose the 'Custom Installation' setup method.
  4. Detailed instructions on the custom installation setup are in the Bamboo documentation. Below are the things you need to know for our Dragon Quest. Enter the 'General Configuration' information as follows:
    • Name: Atlassian Bamboo.
    • Base URL – Enter the full website address at which your Bamboo server is running, not just 'localhost'. For example, if your computer name is 'coopers' then the base URL should be: http://coopers:8085/bamboo. Or specify a website address, such as http://www.foobar.com:8085/bamboo.
    • Configuration Directory – Leave this at the default value.
    • Build Data Directory – Leave this at the default value.
    • Build Working Directory – Leave this at the default value.
    • Artifacts Directory – Leave this at the default value.
    • Broker URL – Check that the URL contains a full URL and not 'localhost'. If necessary, replace localhost with the real host name or IP address of your Bamboo server. For example, if your computer name is 'coopers' then the broker URL should look like this: tcp://coopers.sydney.atlassian.com:54663?wireFormat.maxInactivityDuration=300000.
  5. Choose External Database for your database configuration and ensure that PostgreSQL 8.2 and above is selected in the dropdown menu.
  6. Enter the following information to connect to the Bamboo database created in step 1 above:
    • Connection Type: Direct JDBC connection.
    • Driver Class Name: org.postgresql.Driver.
    • Database URL: jdbc:postgresql://localhost:5432/bamboo.
    • User Name: bamuser.
    • Password – Enter the password you specified in step 1 above.
    • Overwrite existing data – Leave this checkbox unselected.
  7. For your 'Starting Data', select 'Create new Bamboo home'.
  8. Set up your 'Administrator User Details':
    • Username: charlie.
    • Password – Enter a password that you will use for the administrator account and enter it again to confirm it.
    • Full Name: Charlie of Atlassian.
    • Email – Enter the address of your administrator email account. We recommend that you give your own email address here.
  9. Click 'Finish'.
    The Bamboo home page will appear.
  10. Now you will check that your Bamboo configuration includes your default executable and JDK. Click 'Administration' in the top navigation bar.
  11. The 'Bamboo Administration' screen will appear. Click 'Executables' in the left-hand menu.
  12. The 'Executables' screen will appear. Look through the list on the left, to see if your build tool is included along with the default tools like Script, MSBuild or Bash. For this integration exercise, we assume that you are using Maven 2. In that case, you should see 'Maven 2' listed in the tabs on the left.
  13. If your executable is not included, click 'Add an executable as a server capability' near the top of the page. The 'Add Capability' panel will appear. Enter the following information:
    • Capability Type: Executable.
    • Type: Maven 2.x.
    • Executable Label: Maven 2.
    • Path – Enter the path to your Maven installation. This should be the same as the value that you have specified in your M2_HOME environment variable. For example: C:\maven2.2\apache-maven-2.2.0 (Windows) or /usr/local/apache-maven/apache-maven-2.2.1 (UNIX).
      If you have installed the Atlassian PDK, Maven can be found in a sub-directory under your Atlassian PDK installation directory. For example, C:\Atlassian\atlassian-plugin-sdk-3.2\apache-maven (Windows) or /usr/local/Atlassian/atlassian-plugin-sdk-3.2/apache-maven (UNIX).
    • Click 'Add'.
  14. Check that your Bamboo configuration includes your JDK. Click 'JDKs' in the left-hand menu.
  15. The 'JDKs' screen will appear. Look through the tabs on the left, to check that your JDK is included. You will need Oracle JDK 1.6 or higher. Note that the JRE alone is not enough. Stage 1 of these instructions will guide you through the installation process. For this integration exercise, we assume that you are using JDK 1.6. In that case, you should see a tab on the left 'JDK 1.6.x_xx (JRE)', as well as a 'JDK' and a 'JDK 1.6' tab. Ensure that your Java Home environment variable is pointing to your JDK directory, not your JRE directory.
  16. If your JDK is not included, click 'add a JDK as a server capability'. The 'Add Capability' panel will appear. Enter the following information.
    • Capability Type: JDK.
    • Label: JDK 1.6.
    • Java Home – Enter the path to your JDK installation. This should be the same as the value that you have specified in your JAVA_HOME environment variable. For example: C:\Java\jdk (Windows) or /opt/java/java_sdk1.6 (UNIX).
    • Click 'Add'.

Screenshot 2 (click to enlarge): Bamboo home page

Problems? Please raise a support ticket for the product you're stuck on, see answers from the community, or search the forum of past dragon slayers.
Victory? Please continue.

Step 4. Hook Bamboo up to JIRA for User Management

When you have completed this step, you will be able to manage your Bamboo users in JIRA and have the same usernames and passwords in JIRA and Bamboo. First you will define the Bamboo application in JIRA. Then you will adjust your Bamboo installation to delegate user management to JIRA.

  1. Go to your JIRA URL in your browser, e.g. http://www.foobar.com:8080.
  2. Log in to JIRA with username charlie.
  3. Click 'Administration' in the top navigation bar.
  4. Click 'Other Applications' in the left-hand navigation panel (under 'Users, Groups & Roles').
  5. The 'Configure Other Applications' screen will appear, showing FishEye and Confluence already configured. Click 'Add Application'.
  6. The 'Add Application' screen will appear. Enter the following information:
    • Application Name: bamboo.
    • Password – Enter a password that Bamboo will use to access JIRA, and enter it again to confirm it.
    • IP Addresses – On a new line, add the IP address or addresses of your Bamboo server. For example: 192.168.10.12.
  7. Click 'Save'.
  8. Leave JIRA up and running, but shut down Bamboo. (On Windows, open your Bamboo console window and press Ctrl+C then enter 'y' next to the 'Terminate batch job' prompt. On UNIX, run {BAMBOO_INSTALL}/bamboo.sh stop.)
  9. Remove the following 'Crowd integration client' JAR from your Bamboo installation folder: {BAMBOO_INSTALL}/webapp/WEB-INF/lib/crowd-integration-client-2.0.7.jar
  10. Download a new 'Crowd integration client' JAR from the download site.
  11. Copy the downloaded JAR to your Bamboo installation folder: {BAMBOO_INSTALL}/webapp/WEB-INF/lib
  12. Edit the {BAMBOO_INSTALL}/webapp/WEB-INF/classes/crowd.properties file and change the following properties:
    • Check that application.name is set to the correct value: bamboo.
    • Change the application.password – Enter the password that Bamboo will use to access JIRA. This must be the same password as you entered when defining Bamboo to JIRA above.
    • Change the application.login.url to point to JIRA's URL: http://localhost:8080/.
    • Change the crowd.server.url to point to JIRA's URL: http://localhost:8080/.
    • Add a new line containing the following text: bamboo.crowd.cache.minutes 60.
      Your crowd.properties file should look like this, except that the password will be your password:
      application.name                        bamboo
      application.password                    bamboo
      application.login.url                   http://localhost:8080/
      
      crowd.server.url                        http://localhost:8080/
      
      session.isauthenticated                 session.isauthenticated
      session.tokenkey                        session.tokenkey
      session.validationinterval              0
      session.lastvalidation                  session.lastvalidation
      
      bamboo.crowd.cache.minutes              60
    • Save the file.
  13. Edit the {BAMBOO_INSTALL}/webapp/WEB-INF/classes/atlassian-user.xml file.
    • Uncomment the Crowd provider and comment out all other lines of code. The code below should be the only lines of uncommented code in your file, after you have finished making these changes:
      <atlassian-user>
        <repositories>
          <crowd key="crowd" name="Crowd Repository"/>
        </repositories>
      </atlassian-user>
    • Save the file.
  14. Edit the {BAMBOO_INSTALL}/webapp/WEB-INF/classes/log4j.properties file.
    • Add the following line:
      log4j.category.com.atlassian.crowd.integration.atlassianuser.UserGroupCache=INFO
    • Save the file.
  15. Start your Bamboo server again, and go to your Bamboo URL in your browser, e.g. http://www.foobar.com:8085/bamboo.
  16. Log in using Charlie's password in JIRA.
    You are now authenticating via JIRA!

Problems? Please raise a support ticket for the product you're stuck on, see answers from the community, or search the forum of past dragon slayers.
Victory? Please continue.

Step 5. Get Bamboo and JIRA Talking

In this step you will configure an application link between JIRA and Bamboo, so that you can later add Bamboo gadgets to JIRA. You will also set up the integration between Bamboo and JIRA, so that you can see your build information in JIRA and your issues in Bamboo.

  1. Go to your JIRA site in your browser.
  2. Click 'Administration' in JIRA's top navigation bar.
  3. Click 'Application Links' in the left-hand panel, under 'System'.
  4. The 'Configure Application Links' screen will appear. Click 'Add Application Link'.
  5. The first screen of the 'Add Application Link' wizard will appear. Copy the base URL for your Bamboo site (e.g. http://coopers:8085/bamboo or http://www.foobar.com:8085/bamboo) and paste it into the 'Server URL' field.
  6. Click 'Next'.
  7. The 'Link to Bamboo' screen will appear. Enter the following information:
    • Create a link back to this server – This option is selected by default. Let it remain selected.
    • Username: charlie. This is the username of the administrator on your Bamboo site.
    • Password – Enter Charlie's password in JIRA (because you are managing your users in JIRA and are therefore using Charlie's user profile in JIRA).
    • Reciprocal Link URL – Leave this field at its default value, pointing to your JIRA site.
  8. Click 'Next'.
  9. The 'Set Users and Trust' screen will appear. Enter the following information:
    • The servers have the same set of users – This option is selected by default. Let it remain selected.
    • These servers fully trust each other – This option is selected by default. Let it remain selected.
  10. Click 'Create'.
  11. Now you will define your Bamboo server to JIRA. Click 'Bamboo Servers' in the 'Global Settings' section of the left-hand navigation panel.
  12. The 'Bamboo Servers' screen will appear. Click 'Add Bamboo server'.
  13. The 'Add Bamboo server' screen will appear. Enter the following information:
    • Server name: Atlassian Bamboo.
    • Description: Atlassian Bamboo.
    • Host URL – Enter the base URL for your Bamboo site, e.g. http://coopers:8085/bamboo or http://www.foobar.com:8085/bamboo.
    • User name: charlie – This is the user name that Bamboo will use to log in to JIRA.
    • Password – Enter Charlie's password as specified in JIRA.
    • Associated JIRA projects – Leave this field empty.
  14. Click 'Add'.
  15. Now you will tell your Bamboo server about your JIRA server. Go back to your Bamboo window/tab in your browser.
  16. Click 'Administration' in Bamboo's top navigation bar.
  17. The 'Bamboo Administration' screen will appear. Click 'JIRA Server' in the 'Communication' section of the left-hand panel.
  18. The 'Add a JIRA Server' screen will appear. Enter the following information:
  19. Password – Enter Charlie's password, as specified in JIRA.
  20. Issue Key: DRA-1 – This is the JIRA issue key for the issue that you created in Dragons stage 1.
  21. Click 'Test'.
    • You should see the following message: 'Successfully retrieved JIRA issue from remote server'. You should also see your issue key and summary under the heading 'Server Response'.
    • If you do not see a successful response, check that you can log in to your JIRA server using the JIRA username and password you have specified on this screen.
  22. Click 'Save'.

Full details are in the JIRA documentation.

Problems? Please raise a support ticket for the product you're stuck on, see answers from the community, or search the forum of past dragon slayers.
Victory? Please continue.

Step 6. Set up a Project and Run a Build

In this step you will create a Bamboo project and run a sample build. For the purposes of this integration exercise, we have provided a Bitbucket repository that you can connect to your Bamboo 'Dragons' plan. We have committed a code change with a JIRA issue key in the commit message, to match a JIRA issue you created earlier. This will allow you to see the JIRA, FishEye and Bamboo integration immediately, without having to do your own commit.

  1. Click 'Create Plan' in Bamboo's top navigation bar.
  2. The 'Create Plan' screen will appear. Click 'Create a New Plan'.
  3. The 'Create a New Plan' screen will appear. Enter the following information in the 'Plan Details' section:
    • Project Name: Dragons.
    • Project Key: DRAG.
    • Plan Name: Main.
    • Plan Key: MAIN.
    • Plan Description: Dragon slaying plan.
  4. Enter the following information in the 'Source Repository' section:
  5. Leave the rest of the fields in the 'Source Repository' and 'Build Strategy' sections at their default values.
  6. Click 'Configure Tasks'.
  7. The 'Configure Tasks' screen will appear. Click 'Add Task'.
  8. The 'Task Types' screen will appear. Find and select 'Maven 2.x'.
  9. The 'Maven 2.x Configuration' panel will appear. Enter the following information:
    • Task Description: Maven build.
    • Executable: Maven 2.
    • Goal – Change clean test to clean.
    • Build JDK – Select your JDK version, e.g. JDK 1.6.
  10. Leave the rest of the fields at their default values and click 'Save'. You have now defined one task in your plan.
  11. Select 'Yes please' under 'Enable this Plan'.
  12. Click 'Create'.
  13. Bamboo will immediately start a build, based on the plan that you have just created. The build may take a few minutes to complete.
  14. The 'Plan Summary' will appear, showing the 'Main' plan in the 'Dragons' project. Click '#1' under 'Recent History' to open the build result summary for build 'DRAG-MAIN-1'. With any luck, the build should be successful.

Screenshot 3 (click to enlarge): Bamboo build in progress



Screenshot 4 (click to enlarge): Bamboo build completed



Full details on creating a plan are in the Bamboo documentation.

Problems? Please raise a support ticket for the product you're stuck on, see answers from the community, or search the forum of past dragon slayers.
Victory? Please continue.

Victory!

Your Bamboo, FishEye and JIRA servers are fully integrated. Here are some of the highlights for you to try.

You can link your builds to JIRA issues in various ways. For example, you can include a JIRA issue key in a commit comment. Details are in the Bamboo documentation. To see the integration happening right now, add a comment to your build:

  • Click 'Comment' on the Bamboo build result summary.
  • Add the following comment: This build is related to DRA-1.
  • Click 'Add'.

Notice the panel showing the JIRA issue details on the Bamboo build result screen. The issue key is hyperlinked so that you can open the issue in JIRA.

Screenshot 5 (click to enlarge): Bamboo build result with links to JIRA issue



Click the 'Issues' tab on the build result screen, to see the JIRA issues for a build result.

Screenshot 6 (click to enlarge): Bamboo build result showing a JIRA issues tab



Go to JIRA to see the Bamboo builds that relate to a particular JIRA issue, project or version. Details are in the JIRA documentation about viewing the Bamboo builds relating to a JIRA issue, project or version. The screenshot below shows the build for a particular issue.

Screenshot 7 (click to enlarge): JIRA issue showing a Bamboo build tab



When you link your FishEye and Bamboo projects to your own source repository and then commit changes, a source link will appear on your Bamboo build result. You will be able to click the source link to view the changed code in FishEye. Unfortunately, you cannot reproduce this now because our sample repository is read-only.

Problems? Please raise a support ticket for the product you're stuck on, see answers from the community, or search the forum of past dragon slayers.
Victory? Please continue.

Grab a Bigger Shield and Go Conquer that Dragon

Document generated by Confluence on Jun 22, 2011 21:05