Skip to content

Deployments

Our main platforms of choice are Heroku and Cloudflare. Using managed services helps us minimise ops tasks, and keeps us focused on the application layer.

Continuous deployment

Where possible we operate a continuous deployment policy, which means that changes are deployed to production as and when they are ready.

Rails app

When CI checks pass on main the production deployment auto-deploys.

Review apps

For our main codebase, we have review apps enabled. This means every PR gets its own deployment environment. When a review app is deployed, it takes a copy of the staging app database.

Staging lock policy

By default the staging deployment is configured to auto-deploy from the main branch (as per production). Sometimes it's necessary to upgrade a review up to staging – for instance, when the feature being tested requires a *bbcmaestro.com domain, or for testing the staging track of the mobile app.

In this instance we operate a "stacking lock" policy.

Steps

  1. Announce that staging has changed on #engineering-staging-lock
  2. Deploy your branch to staging
  3. (after testing) Revert staging to main
  4. Release lock on #engineering-staging-lock

Step 1: Announce staging is locked

  • Go to #engineering-staging-lock in Slack and type /lock
  • Select ‘Lock staging environment’
  • Fill in the form with yourself, an expected end time to your testing, and any other details for other developers, then click Submit.

Step 2: Deploy your branch to staging

  • Go to Heroku and find the staging deployment
  • Disable automatic deploys
  • Under ‘Manual Deploy’ select the branch you want to deploy and click ‘Deploy branch'
  • Wait for the build to finish, you can now test your code on Staging

Step 3: (after testing) revert staging back to main

  • Enable automatic deploys
  • After re-enabling automatic deploys you will need to manually redeploy the main branch to bring things back in line with production.

Step 4: Release the staging lock

  • Go to the slack channel #engineering-staging-lock
  • Click ‘Unlock now’ against your staging lock

Mobile app

[TODO]