This document describes the process of manually deploying to a particular environment.
In the event that code changes are made to the app but the pipelines fail to complete the deployment stages this process should be followed to deploy the commit manually, or the main branch.
These below instructions can also be used to rollback or to deploy an arbitary commit with an build image.
This process assumes that the build and test stage has completed without error and a Docker image has been uploaded to the GitHub container registry successfully.
-
Grab the commit sha to be used from either the Apply ops dashboard or the build workflow, in case of a rollback use the commit sha of the previous commit that needs to be deployed. To deploy the
main
branch, use "main". -
Go the deploy workflow and click on the "Run workflow" dropdown button, you'll see a list of apply environments like below.
-
Now paste the commit sha to be used in the "Commit sha to be deployed" textbox and
true
into the textboxes for the environments you want this commit to be deployed. Eg: if you want to deploy this commit only toqa
entertrue
into the textbox below the "Deploy to qa?" label and leave the rest asfalse
. -
Click on the "Run workflow" button, this should trigger a run workflow run and deploy the commit sha to the selected environments.
NOTE: Before following the steps below you will need to request an elevation of your rights to the 'contributor' role through PIM in the Azure Portal if working on an app hosted in the test or production subscriptions. Guidance on PIM can be found in the PIM Guide document. PIM is not required in the development subscription.
Make commands can be run from the root of the repo to deploy a specific version to one of the environments.
-
Grab the commit sha to be used from either the Apply ops dashboard or the build workflow. This is only required to deploy a particular commit instead of the current
main
branch. -
Copy a passcode for the cf cli from https://login.london.cloud.service.gov.uk/passcode
-
Login to Azure via
az
cli:az login
-
From the root of the repo you can run the below command to deploy the app.
make <ENV> deploy IMAGE_TAG=<COMMIT_SHA> passcode=<CF_SSO_CODE> eg: make qa deploy IMAGE_TAG=4ebb7d13010839b1ab2b7ae0dfef57460a5101f3 passcode=XXXXXX
To deploy
main
, simply use:make <ENV> deploy passcode=<CF_SSO_CODE> eg: make qa deploy passcode=XXXXXX
This will list the changes about to be deployed and prompt for a confirmation, you can type "yes" to confirm and the changes will be applied.
Environment make command PIM required qa make qa deploy no staging make staging deploy yes (s121-findpostgraduateteachertraining-test) sandbox make sandbox deploy yes (s121-findpostgraduateteachertraining-production) production make prod deploy yes (s121-findpostgraduateteachertraining-production) You can also just preview the changes by running
deploy-plan
instead ofdeploy
in the above command. -
Check the
#twd_apply_tech
Slack channel for any runtime errors from Sentry or the smoke tests before proceeding to the next environment.