Skip to content

Commit

Permalink
Merge pull request #553 from rcpch/mbarton/lets-do-it-live
Browse files Browse the repository at this point in the history
Stand up live instance
  • Loading branch information
mbarton authored Feb 6, 2025
2 parents 6ad3c7c + 3176d7c commit 6f0e077
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
AZURE_CONFIG_STORAGE_ACCOUNT: ${{ secrets.AZURE_CONFIG_STORAGE_ACCOUNT }}
AZURE_CONFIG_FILE_SHARE: ${{ secrets.AZURE_CONFIG_FILE_SHARE }}
AZURE_STAGING_APP_NAME: ${{ secrets.AZURE_STAGING_APP_NAME }}
AZURE_LIVE_APP_NAME: ${{ secrets.AZURE_LIVE_APP_NAME }}
AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }}
run: s/ci

Expand Down
3 changes: 2 additions & 1 deletion .prout.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"checkpoints": {
"STAGING": { "url": "https://npda-staging.rcpch.tech", "overdue": "15M" }
"STAGING": { "url": "https://npda-staging.rcpch.tech", "overdue": "15M" },
"LIVE": { "url": "https://npda.rcpch.ac.uk", "overdue": "15M" }
}
}
6 changes: 6 additions & 0 deletions s/ci
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,10 @@ az containerapp revision copy \
--image ${azure_tag} \
--query 'properties.provisioningState'

az containerapp revision copy \
--name ${AZURE_LIVE_APP_NAME} \
--resource-group ${AZURE_RESOURCE_GROUP} \
--image ${azure_tag} \
--query 'properties.provisioningState'

# Deploy to the docs is handled in the GitHub workflow itself
6 changes: 3 additions & 3 deletions s/psql
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ done

function connect_to_azure_db() {
local host="npda-$1.postgres.database.azure.com"
local user="NPDA\ Database\ Owners"
local user="$3"
local dbname="$2"

local access_token=$(az account get-access-token --resource-type oss-rdbms --query 'accessToken' --output tsv)
Expand All @@ -32,11 +32,11 @@ case ${ENVIRONMENT} in
;;

'staging')
connect_to_azure_db 'staging' 'npda_staging'
connect_to_azure_db 'staging' 'npda_staging' "NPDA\ Database\ Owners"
;;

'live')
connect_to_azure_db 'live' 'npda_live'
connect_to_azure_db 'live' 'npda_live' "NPDA\ Live\ Database\ Owners"
;;

*)
Expand Down

0 comments on commit 6f0e077

Please sign in to comment.