Commit db13a89 1 parent 651db2c commit db13a89 Copy full SHA for db13a89
File tree 4 files changed +67
-2
lines changed
4 files changed +67
-2
lines changed Original file line number Diff line number Diff line change @@ -210,5 +210,6 @@ output identityPrincipalIds array = [
210
210
211
211
output containerAppEnvName string = containerAppEnv .name
212
212
output webApiSoName string = webapiSo .name
213
+ output webApiSoRevisionName string = webapiSo .properties .latestRevisionName
213
214
output webApiEuName string = webapiEu .name
214
215
output migrationJobName string = migrationJob .name
Original file line number Diff line number Diff line change @@ -333,3 +333,4 @@ module keyVaultReaderAccessPolicy 'keyvault/addReaderRoles.bicep' = {
333
333
334
334
output migrationJobName string = containerAppsExternal .outputs .migrationJobName
335
335
output resourceGroupName string = resourceGroup .name
336
+ output webapiSoRevisionName string = containerAppsExternal .outputs .webApiSoRevisionName
Original file line number Diff line number Diff line change
1
+ if [ -z " $1 " ]; then
2
+ echo " Usage: $0 <revision-name>"
3
+ exit 1
4
+ fi
5
+
6
+ if [ -z " $2 " ]; then
7
+ echo " Usage: $0 <resource-group-name>"
8
+ exit 1
9
+ fi
10
+
11
+ revision_name=" $1 "
12
+ resource_group=" $2 "
13
+ query_filter=" {name:name, runningState:properties.runningState, healthState:properties.healthState}"
14
+
15
+ verify_revision () {
16
+ local json_output
17
+
18
+ # Fetch app revision
19
+ json_output=$( az containerapp revision show -g " $resource_group " --revision " $revision_name " --query " $query_filter " 2> /dev/null)
20
+
21
+ health_state=$( echo $json_output | jq -r ' .healthState' )
22
+ running_state=$( echo $json_output | jq -r ' .runningState' )
23
+
24
+ echo " Revision $revision_name status:"
25
+ echo " -----------------------------"
26
+ echo " Health state: $health_state "
27
+ echo " Running state: $running_state "
28
+ echo " "
29
+
30
+ # Check health and running status
31
+ if [[ $health_state == " Healthy" && ($running_state == " Running" || $running_state == " RunningAtMaxScale" ) ]]; then
32
+ return 0 # OK!
33
+ else
34
+ return 1 # Not OK!
35
+ fi
36
+ }
37
+
38
+ attempt=1
39
+
40
+ # Loop until verified (GitHub action will do a timeout)
41
+ while true ; do
42
+ if verify_revision; then
43
+ echo " Revision $revision_name is healthy and running"
44
+ break
45
+ else
46
+ echo " Attempt $attempt : Waiting for revision $revision_name ..."
47
+ sleep 10 # Sleep for 10 seconds
48
+ attempt=$(( attempt+ 1 ))
49
+ fi
50
+ done
Original file line number Diff line number Diff line change 2
2
3
3
on :
4
4
workflow_call :
5
+ env :
6
+ AZ_CLI_VERSION : 2.56.0
7
+
5
8
secrets :
6
9
AZURE_CLIENT_ID :
7
10
required : true
56
59
uses : azure/CLI@v1
57
60
id : keyvault-keys
58
61
with :
59
- azcliversion : 2.56.0
62
+ azcliversion : ${{ env.AZ_CLI_VERSION }}
60
63
inlineScript : |
61
64
KEY_VAULT_KEYS=$(az keyvault secret list --vault-name ${{ secrets.AZURE_SOURCE_KEY_VAULT_NAME }} --subscription ${{ secrets.AZURE_SOURCE_KEY_VAULT_SUBSCRIPTION_ID }} --query "[].name" -o json | tr -d '\n')
62
65
echo "::set-output name=key-vault-keys::$KEY_VAULT_KEYS"
@@ -98,10 +101,20 @@ jobs:
98
101
uses : azure/CLI@v1
99
102
if : ${{!inputs.dryRun}}
100
103
with :
101
- azcliversion : 2.56.0
104
+ azcliversion : ${{ env.AZ_CLI_VERSION }}
102
105
inlineScript : |
103
106
az containerapp job start -n ${{ steps.deploy.outputs.migrationJobName }} -g ${{ steps.deploy.outputs.resourceGroupName }}
104
107
108
+ - name : Verify deployment running
109
+ timeout-minutes : 3
110
+ uses : azure/CLI@v1
111
+ id : verify-deployment
112
+ with :
113
+ azcliversion : ${{ env.AZ_CLI_VERSION }}
114
+ inlineScript : |
115
+ ./.github/tools/revisionVerifier.sh "${{ steps.deploy.outputs.webApiSoRevisionName }} ${{ steps.deploy.outputs.resourceGroupName }}"
116
+
117
+
105
118
- name : Logout from azure
106
119
if : ${{failure() || success()}}
107
120
continue-on-error : true
You can’t perform that action at this time.
0 commit comments