BitBucket information and configuration

 

Recommended EC2 Server Types - c5.xlarge, m5.xlarge, m4.xlarge - Highly dependent on Cluster size and data involved.

 

Recommended RDS Node Types - T3.Medium or T3.Large:

Must be a POSTGRES SQL DB.

  • T3.Medium 
  • T3.Large 

Turbot Bitbucket Configuration:

RDS and EC2 Install for Bitbucket:

  1. Create an external Database for Bitbucket.
    1. Open your Turbot Master account in AWS, and Navigate to RDS.
    2. Create Database > Choose Engine > Postgresql, Choose the Production Use case.
    3. Verify your DB Instance size our sizing recommendation is a T3.Medium or T3.Large.
    4. Our sizing recommendation for Storage is General Purpose (SSD) at 250GiB.
    5. Configure your RDS DB Settings by setting the Name of the Instance, and creating a Master username and password. Please note: Make sure you save this information.
    6. If you run into issues please see: https://confluence.atlassian.com/bitbucketserver/connecting-bitbucket-server-to-postgresql-776640389.html
  2. Install Bitbucket Instance in the same VPC as the Turbot Worker nodes according to Atlassian's instructions. Note: You will need access to the localhost:8080 in a web browser to finish the bitbucket server installation.
  3. For Linux Instances please move on to Linux Setup.
  4. For Windows Instances please move on to Windows Setup.
  5. Single Bitbucket Server Instance:
    1. Spin up a new Linux and or Windows instance
    2. Create a Bitbucket Security Group with the following ports open for Inbound connection:
      • TCP 7990: Default HTTP port - need to open to the public if this needs to be accessed externally
      • TCP 7993
      • TCP 7992
      • TCP 8443
  6. Ensure that the Turbot Worker has outbound access to the VPC. Change the default Security Group to allow outbound access to the VPC.

Linux Server Setup:

  1. Download the installer- www.atlassian.com/software/bitbucket/download and make the installer executable. You can do this by navigating to the directory where the installer is located in the terminal and using the command: 
    chmod +x atlassian-bitbucket-x.x.x-x64.bin (Where X.X.X is is the Bitbucket Server version you downloaded.)
  2. Run the installer – we recommend using sudo to run the installer as this will create a dedicated account to run Bitbucket Server and allow you to run Bitbucket Server as a service.
  3. Follow the prompts to install Bitbucket. You'll be asked for the following info:
    • Type of Bitbucket instance - the type of installation, for these instructions select Standard.
    • Installation directory - where Bitbucket will be installed.
    • Home directory - where Bitbucket application data will be stored.
    • TCP ports - the HTTP connector port and control port Bitbucket will run on.
  4. Once the installer completes, head to http://localhost:7990 in your browser to begin the setup process.
  5. Proceed to Bitbucket Setup below.

Windows Server Setup:

  1. Download Bitbucket Server found here - www.atlassian.com/software/bitbucket/download.
  2. Run the installer. We recommend using a Windows administrator account.
  3. Follow the prompts to install Bitbucket. You'll be asked for the following info:
    • Type of Bitbucket instance - the type of installation, for these instructions select Standard.
    • Installation directory - where Bitbucket will be installed.
    • Home directory - where Bitbucket application data will be stored.
    • TCP ports - the HTTP connector port and control port Bitbucket will run on.
  4. Once the installer completes, launch Bitbucket in a browser.
  5. Move on to Bitbucket Setup below.

Bitbucket Setup:

The Setup Wizard runs automatically when you visit Bitbucket Server in your browser the first time.

  1. Connect to your database
    • If you've not already done so, it's time to create your database. See the 'Before you begin' section of this page for details.
    • Select External as your database, then choose a Database Type from the drop-down menu and enter the details of your database.
  2. Add your license key
    • Follow the prompts to log in to my.atlassian.com to retrieve your license, or enter a license key.
    • You can also set the base URL at this step, though you can elect to do this later.
  3. Create your administrator account
    • Enter details for the administrator account.
    • Click either Go to Bitbucket to go straight to the Bitbucket Server interface, or Integrate with Jira to create your connection with an existing Jira application.
  4. Move on to the Turbot Cluster Setup below.

Turbot Cluster Setup:

  1. Go to the Turbot-Console Cloud Formation Stack in the Turbot Master Account.
  2. Choose Update stack.
  3. Find the Flags parameter and add GitServerType to the existing Flags.
  4. Create a service user in Bitbucket that Turbot will use to create the repository.
  5. Create a Project in Bitbucket called 'Turbot'. Set the project key as 'BOT'. If you change the project key, make note this change.
  6. Set the following policies at Turbot level in the Turbot UI:
    • Turbot > CMDB > Bitbucket Project Key -> Defaults to BOT. Only set this policy if the project name from step 5 has been changed.
    • Turbot > CMDB > Git Repository Endpoint -> The endpoint URL for the Bitbucket server. For example: http://ec2-52-61-26-77.us-gov-west-1.compute.amazonaws.com:7990
    • Turbot > CMDB > Git Repository Password -> The password for the service user
    • Turbot > CMDB > Git Repository Type -> Bitbucket
    • Turbot > CMDB > Git Repository Username -> The username for the service user.
  7. Reboot Turbot Worker and Web servers.
  8. Once the servers have been rebooted, navigate to the Controls tab at the Turbot Master level.
  9. Search for Repository Exists and run a Check and then Apply to ensure the repositories are created.

Please Note: If there are issues with the Bitbucket server not creating a repository, make sure to use a simple yet lengthy password. It has been known to prompt for Captchas at the Bitbucket login which can cause issues with Turbot creating the repositories. You can change Captcha settings from the Settings > Authentication page.

 

Troubleshooting

If the Repository Exists control doesn't appear in the Controls list, it can be accessed directly by going to https://{turbot-hostname}/r/urn:turbot/controls/urn:turbot:::guardrail:Turbot:CMDB:RepositoryExists

By changing the URN for Turbot, Clusters and Accounts in the above URL can be accessed.

Was this article helpful?
0 out of 0 found this helpful