Skip to content

Recycling our test BBS Servers

Arin Ghazarian edited this page Feb 9, 2023 · 4 revisions

We are currently using trial licenses for the BBS Servers in our end-to-end integration tests. This means that every 30-90 days the license expires. We should probably look into setting them up with non-trial licenses, but for now we've been destroying and rebuilding new servers when the licenses expire. We could probably automate 95% of this process if we wanted to. This is the steps to manually rebuild one of our BBS testing servers:

  1. In Azure portal go to the resource group octoshift-cli-integration-testing in the subscription GitHub - NonProd - Idea-to-code - ADO Integration
  2. For each server you are rebuilding there will be 6 resources that need to be deleted, they should all be named similar to the server. E.g. here are the 6 resources for one BBS server:
  • e2e-bbs-8-5-0-linux-2204 (Virtual Machine)
  • e2e-bbs-8-5-0-linux-2204 (SSH Key)
  • e2e-bbs-8-5-0-linux-2204-ip (Public IP Address)
  • e2e-bbs-8-5-0-linux-2204-nsg (Network Security Group)
  • e2e-bbs-8-5-0-lin906 (Network Interface)
  • e2e-bbs-8-5-0-linux-2204_disk1_537ec3a2e68744deb402a9a56d277efb (Disk)
  1. Create a new Azure VM from the appropriate Ubuntu image (hit Create and search for Ubuntu Server 22.04). These are the only settings you may need to change from the defaults:
  • Resource Group: octoshift-cli-integration-testing
  • Virtual Machine Name: Name according to our existing patterns (e.g. e2e-bbs-8-5-0-linux-2204 which implies BBS v8.5.0 and Linux/Ubuntu 22.04)
  • Region: East US
  • Availability Options: No Infrastructure Redundancy Required
  • Size: Standard_D2s_v3
  • SSH Username: octoshift
  • Key pair name: Name the same as the server name
  1. When you finish clicking through the Create VM wizard you should be prompted to download the SSH certificate file to your computer
  2. Once the VM has finished creating go to the VM->Networking section and and an Inbound Port rule to allow ports 7990->7994 for BBS
  3. Setup a DNS name for the VM (there is a link to do this from the top-right in the VM overview page). The DNS name should be the same as the VM name (e.g. e2e-bbs-8-5-0-linux-2204.eastus.cloudapp.azure.com)
  4. Download the relevant BBS installer version from https://www.atlassian.com/software/bitbucket/download-archives (for linux servers select the Linux 64 bit option on the download page)
  5. You may need to modify the permissions on the SSH certificate file you downloaded earlier
  • chmod 600 e2e-bbs-8-5-0-linux-2204.pem
  1. SCP the bitbucket installer to the BBS server
  • scp -i e2e-bbs-8-5-0-linux-2204.pem atlassian-bitbucket-8.5.0-x64.bin octoshift@e2e-bbs-8-5-0-linux-2204.eastus.cloudapp.azure.com:
  1. SSH into the BBS server
  • ssh -i e2e-bbs-8-5-0-linux-2204.pem octoshift@e2e-bbs-8-5-0-linux-2204.eastus.cloudapp.azure.com
  1. Make the installer executable
  • chmod a+x atlassian-bitbucket-8.5.0-x64.bin
  1. Run the BBS installer
  • sudo ./atlassian-bitbucket-8.5.0-x64.bin
  • Accept all the default options (e.g. paths, ports, etc)
  • Choose to run it as a service
  • Once installation is complete choose the option to run BBS
  1. Fire up a browser and navigate to your BBS server (e.g. http://e2e-bbs-8-5-0-linux-2204.eastus.cloudapp.azure.com:7990)
  • Click through the default setup options
  • You'll need to click through to acquire a trial license by logging into an atlassian account and generating a license key, the wizard will walk you through this
  1. Update the repo secret SSH_KEY_BBS_X_X_X to contain the contents of the SSH certificate pem file downloaded earlier.
  2. Update the secret in 1password called CLI E2E BBS SSH Key
  3. Run a CI workflow to make sure everything works.
Clone this wiki locally