Atlassian Integration Guide : Dragons Stage 7 - Install Bamboo This page last changed on Apr 07, 2010 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 Crowd, 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 Step 2. Install Bamboo Step 3. Set Up Bamboo Step 4. Hook Bamboo up to Crowd Step 5. Get Bamboo and JIRA Talking Step 6. Set up a Project and Run a Build Victory! ## 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. Start pgAdmin III. 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. Select 'Can create database objects'. Select 'Can create roles'. Click 'OK' to create the user. 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.3/bin/createuser -S -d -r -P -E bamuser
    # Create the Bamboo database:
    /opt/PostgreSQL/8.3/bin/createdb -O bamuser bamboo
    exit
11. Screenshot 1 (click to enlarge): Bamboo database and user in PostgreSQL ## Step 2. Install Bamboo Requirements: Bamboo 2.5.3. For Windows: (click to expand) Go to the Atlassian download centre. Download the 'Standalone (Windows Installer)' file for Bamboo 2.5.3. Launch the Bamboo Windows installer (`atlassian-bamboo-2.5.3-standalone.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`. Click 'Finish' to close the setup window when the installer has finished. Install Bamboo as a Windows Service, so that it starts each time you start Windows by running {`BAMBOO_INSTALL\InstallAsService.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'. Start your Bamboo server by running {`BAMBOO_INSTALL\StartBamboo.bat` You may also need to run this file in administrative mode as described in the previous step. For UNIX or Linux: (click to expand) Go to the Atlassian download centre. Click the 'Linux' tab and download the 'Standalone (TAR.GZ Archive)' file for Bamboo 2.5.3. Unpack the tar.gz archive into a directory of your choice, avoiding spaces in the directory name. Tell Bamboo where to put its Bamboo Home directory: Edit the properties file at {`BAMBOO_INSTALL}/bamboo/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. Start your Bamboo server by running {`BAMBOO_INSTALL}/bamboo.sh start`. Problems? Please go immediately to the Dragon Slayers' Forum. 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. See the Bamboo documentation. For this integration exercise, we assume that you are using Maven 2. 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, 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. To access Bamboo, go to your web browser and type this address: http://localhost:8085/. The Bamboo Setup Wizard will start up, 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. Detailed instructions on the custom installation setup method are in the Bamboo documentation. Below are the things you need to know for our Dragon Quest. Enter the 'Bamboo Configuration' information as follows: Name of Bamboo instance: `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`. Or specify a website address, such as `http://www.foobar.com:8085`. 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. 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`. Choose `External Database` for your database configuration and ensure that `PostgreSQL 8.2 and above` is selected in the dropdown menu. Enter the following information to connect to your Bamboo database created in step 1 above: Database Connection: `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. For your 'Starting Data', select 'Create new Bamboo home'. Set up your 'Administrator User Details': Username: `charlie`. Password – Enter a password 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. Click 'Finish'. You can now see the Bamboo home page. Now you will check that your Bamboo configuration includes your default builder and JDK. Click 'Administration' in the top navigation bar and log in with username charlie and the password you specified when prompted. The 'Bamboo Administration' screen will appear. Click 'Builders' in the left-hand menu. The 'Builders' screen will appear. Look through the list, to see if your build tool is included for 'All local agents'. For this integration exercise, we assume that you are using Maven 2. In that case, you should see an 'All local agents' link in the 'Agents' column for 'Maven 2'. If your builder is not included, click 'Add builder to server capabilities'. The 'Add Capability' panel will appear. Enter the following information then click 'Add': Capability Type: `Builder`. Type: `Maven 2.x`. 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.0.6\apache-maven` (Windows) or `/usr/local/Atlassian/atlassian-plugin-sdk-3.0.6/apache-maven` (UNIX). Check that your Bamboo configuration includes your JDK. Click 'JDKs' in the left-hand menu. The 'JDKs' screen will appear. Look through the list, to check that your JDK is included for 'All local agents'. You will need Sun JDK 1.5 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 row in the table for 'JDK 1.6.x_xx', where the 'Agent' column includes 'All local agents'. If your JDK is not included, click 'Add JDK to server capabilities'. The 'Add Capability' panel will appear. Enter the following information then click 'Add': 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:\Sun\SDK\jdk` (Windows) or `/opt/java/java_sdk1.6` (UNIX). Screenshot 2 (click to enlarge): Bamboo home page Problems? Please go immediately to the Dragon Slayers' Forum. Victory? Please continue. ## Step 4. Hook Bamboo up to Crowd Follow the steps below to hook Bamboo up to Crowd for SSO and centralised user management. If Crowd is not already running, start it up by running {`CROWD_INSTALL}/start_crowd.bat` and go to your Crowd URL in your browser, e.g. `http://www.foobar.com:8095/crowd`. Log in to Crowd with username `charlie`. Click 'Applications' in the top navigation bar. The 'Application Browser' will appear. Click 'Add Application' in the left-hand menu. This will display the first screen for the 'Add Application' wizard for Crowd. Enter the following information: Application Type: `Bamboo`. Name: `bamboo`. Description: `Atlassian Bamboo`. Password – Enter a password that Bamboo will use to access Crowd and enter it again to confirm it. URL – Enter the base URL of your Bamboo site, as configured in step 3 above, e.g. `http://www.foobar.com:8085`. Click 'Resolve IP Address' to ask Crowd to find the 'Remote IP Address' for you. The value will be something like this: `127.0.0.1`. Select the '`Crowd`' directory that you created in Dragons Stage 1. Select 'Allow all users to authenticate'. Click 'Add Application'. Check the IP addresses for your Bamboo application: Click the 'Remote Addresses' tab. Add your Bamboo host name, e.g. `http://www.foobar.com:8085`. If it's not already present, add: `127.0.0.1`. Leave Crowd up and running, but shut down Bamboo. (On Windows, open your 'Start' menu and select 'Programs', 'Bamboo', 'Stop Service'. On UNIX, run {`BAMBOO_INSTALL}/bamboo.sh stop`. You may need to run this program in administrative mode as described above.) Remove the following file from your Bamboo installation folder: {`BAMBOO_INSTALL}/webapp/WEB-INF/lib/crowd-integration-client-1.6.1.jar` Copy the Crowd client libraries and configuration files to your Bamboo installation folder: Copy {`CROWD_INSTALL}/client/crowd-integration-client-2.0.3.jar` to {`BAMBOO_INSTALL}/webapp/WEB-INF/lib` Copy {`CROWD_INSTALL}/client/conf/crowd.properties` to {`BAMBOO_INSTALL}/webapp/WEB-INF/classes` Copy {`CROWD_INSTALL}/client/conf/crowd-ehcache.xml` to {`BAMBOO_INSTALL}/webapp/WEB-INF/classes` Edit the {`BAMBOO_INSTALL}/webapp/WEB-INF/classes/crowd.properties` file and change the following properties: application.name: `bamboo` application.password – Enter the password that Bamboo will use to access Crowd. This must be the same password as you entered in the Crowd 'Add Application' wizard above. 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>
12. Edit the {`BAMBOO_INSTALL}/webapp/WEB-INF/classes/seraph-config.xml` file. Comment out the `authenticator` node :
        <!--<authenticator class="com.atlassian.bamboo.user.authentication.BambooAuthenticator"/>-->
    and add a new one:
        <authenticator class="com.atlassian.crowd.integration.seraph.BambooAuthenticator"/>
Start your Bamboo server again, and go to your Bamboo URL in your browser, e.g. `http://www.foobar.com:8085`. If you experience problems with the Windows service you can start Bamboo in a console window instead, by running {`BAMBOO_INSTALL}\bin\BambooConsole.bat`. If you are still logged in to Crowd, you will be automatically logged in to Bamboo with username `charlie`. If not, log in using Charlie's password in Crowd. You are now authenticating and using single sign-on via Crowd! Full details are in the Crowd documentation. Problems? Please go immediately to the Dragon Slayers' Forum. Victory? Please continue. ## Step 5. Get Bamboo and JIRA Talking In this step you will set up the integration between Bamboo and JIRA, so that you can see your build information in JIRA and your issues in Bamboo. First you will tell your JIRA server about your Bamboo server. Keep Bamboo open in your browser, and open another browser window/tab. Go to your JIRA site in the second window/tab. Because you are using Crowd for single sign-on, you should be automatically logged in to JIRA with username `charlie`. Click 'Administration' in JIRA's top navigation bar. The 'Projects' administration screen will appear. Click 'Bamboo Servers' (in the 'Global Settings' section). The 'Bamboo Servers' screen will appear. Click 'Add Bamboo server'. 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` or `http://www.foobar.com:8085`. 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 Crowd. Associated JIRA projects – Leave this field empty. Click 'Add'. Now you will tell your Bamboo server about your JIRA server. Go back to your Bamboo window/tab in your browser. Click 'Administration' in Bamboo's top navigation bar. The 'Bamboo Administration' screen will appear. Click 'JIRA Server' in the left-hand menu (in the 'Communication' section). The 'Add a JIRA Server' screen will appear. Enter the following information: Host URL – Enter the base URL for your JIRA site, e.g. `http://coopers:8080` or `http://www.foobar.com:8080`. Username: `charlie` – This is the user name that JIRA will use to log in to Bamboo. Password – Enter Charlie's password, as specified in Crowd. Issue Key: `DRA-1` – This is the JIRA issue key for the issue that you created in Dragons stage 2. 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 account and password you have specified on this screen. Click 'Save'. Full details are in the Bamboo documentation. Problems? Please go immediately to the Dragon Slayers' Forum. 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 read-only Subversion 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. Click 'Create Plan' in Bamboo's top navigation bar. The 'Create a new plan' screen will appear. Enter the following information: Project Name: `Dragons`. Project Key: `DRAG`. Build Plan Name: `Main` Build Plan Key: `MAIN` Click 'Next' and enter the following information. Repository: `Subversion`. Repository URL: `http://dragons.atlassian.com/dragons`. Username and Password – Not required for our sample repository, because the repository allows anonymous access. Authentication Type – Leave this at the default value of '`Password`'. Web Repository – Select 'FishEye'. FishEye URL – Enter the URL of your 'Dragons' source project in FishEye, e.g. `http://foobar:8060/` or `http://fisheye.foobar.com:8060/`. Repository Name — `Dragons` Leave the rest of the fields at their default values and click 'Next'. Enter the following information: Builder – Select your build tool, e.g. `Maven 2`. JDK – Select your JDK version, e.g. `JDK 1.6`. Leave the rest of the fields at their default values and click 'Save'. Bamboo will immediately start a build, based on the plan that you have just created. The build may take a few minutes to complete. When the build has finished, you will see a build result for build '`DRAG-MAIN-1`'. This is the build '`1`' based on your new plan '`MAIN`' in your project '`DRAG`'. 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 Click the 'Summary' tab to see the plan summary. Screenshot 5 (click to enlarge): Bamboo plan summary Full details on creating a plan are in the Bamboo documentation. Problems? Please go immediately to the Dragon Slayers' Forum. 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: In Bamboo, click 'DRAG-MAIN-1' to open the build result summary. Click 'Actions' then 'Add comment'. Add the following comment: `This build is related to DRA-1`. Click 'Save'. Click the 'Summary' tab to go back to the build result summary. 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 6 (click to enlarge): Bamboo build result with links to JIRA issue Click the 'Issues' tab to see the JIRA issues for a build result. Screenshot 7 (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 8 (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. The screenshot below is for information only. Screenshot 9 (click to enlarge): Bamboo build result showing link to FishEye source view Problems? Please go immediately to the Dragon Slayers' Forum. Victory? Please continue.
| ##### Grab a Bigger Shield and Go Conquer that Dragon Tweet? Tweet. Go to Dragons Stage 8 - Bamboo Gadgets and JIRA Victory.
Attachments: PGAdminBambooDB.png (image/png) BambooHomePage.png (image/png) BambooBuildInProgress.png (image/png) BambooBuildSuccessful.png (image/png) BambooBuildSuccessful.png (image/png) BambooJIRAIssues.png (image/png) BambooBuildSuccessful-annotated.png (image/png) JIRAIssueBuild.png (image/png) BambooBuildComplete.png (image/png) BambooBuildInProgress.png (image/png) BambooPlanSummary.png (image/png) BambooBuildSuccessful.png (image/png) BambooJIRAIssues.png (image/png) JIRAIssueBuild.png (image/png) BambooBuildSuccessful-annotated.png (image/png) BambooBuildComplete.png (image/png) BambooBuildInProgress.png (image/png) BambooBuildSuccessful.png (image/png) BambooBuildSuccessful-annotated.png (image/png) BambooHomePage.png (image/png) BambooJIRAIssues.png (image/png) BambooPlanSummary.png (image/png) JIRAIssueBuild.png (image/png)

Document generated by Confluence on Apr 07, 2010 22:35