@@ -26,6 +26,13 @@ variables:
2626 value : ' nhsnlink-aks'
2727- name : nhsn_resourcegroup
2828 value : ' nhsnlink-rg'
29+ - name : env
30+ ${{ if eq(parameters.environment, 'dev-scale') }} :
31+ value : ' dev'
32+ ${{ if eq(parameters.environment, 'scale-test') }} :
33+ value : ' test'
34+ ${{ if eq(parameters.environment, 'scale-qa') }} :
35+ value : ' qa'
2936
3037jobs :
3138
@@ -82,58 +89,77 @@ jobs:
8289 serviceName : account
8390 repoName : account
8491 containerName : account
92+ healthUrl : https://$(env)-account.nhsnlink.org/health
8593 admin :
8694 serviceName : admin
8795 repoName : admin
8896 containerName : admin
97+ healthUrl : https://$(env)-admin.nhsnlink.org/api/health
8998 admin-ui :
9099 serviceName : admin-ui
91100 repoName : admin-ui
92101 containerName : admin-ui
102+ healthUrl : https://$(env)-admin.nhsnlink.org/
93103 audit :
94104 serviceName : audit
95105 repoName : audit
96106 containerName : audit
107+ healthUrl : https://$(env)-audit.nhsnlink.org/health
97108 census :
98109 serviceName : census
99110 repoName : census
100111 containerName : census
112+ healthUrl : https://$(env)-census.nhsnlink.org/health
101113 data-acquisition :
102114 serviceName : data-acquisition
103115 repoName : dataacquisition
104116 containerName : data
117+ healthUrl : https://$(env)-data.nhsnlink.org/health
105118 data-acquisition-worker :
106119 serviceName : data-acquisition-worker
107120 repoName : dataacquisition-worker
108121 containerName : data-worker
122+ healthUrl : https://$(env)-data.nhsnlink.org/health
109123 measure-eval :
110124 serviceName : measure
111125 repoName : measureeval
112126 containerName : measure
127+ healthUrl : https://$(env)-measure.nhsnlink.org/health
113128 normalization :
114129 serviceName : normalization
115130 repoName : normalization
116131 containerName : normalization
132+ healthUrl : https://$(env)-normalization.nhsnlink.org/health
117133 query-dispatch :
118134 serviceName : query-dispatch
119135 repoName : querydispatch
120136 containerName : query-dispatch
137+ healthUrl : https://$(env)-querydispatch.nhsnlink.org/health
121138 report :
122139 serviceName : report
123140 repoName : report
124141 containerName : report
142+ healthUrl : https://$(env)-report.nhsnlink.org/health
125143 submission :
126144 serviceName : submission
127145 repoName : submission
128146 containerName : submission
147+ healthUrl : https://$(env)-submission.nhsnlink.org/health
129148 tenant :
130149 serviceName : tenant
131150 repoName : tenant
132151 containerName : tenant
152+ healthUrl : https://$(env)-tenant.nhsnlink.org/health
153+ terminology :
154+ serviceName : terminology
155+ repoName : terminology
156+ containerName : terminology
157+ healthUrl : https://$(env)-terminology.nhsnlink.org/health
133158 validation :
134159 serviceName : validation
135160 repoName : validation
136161 containerName : validation
162+ healthUrl : https://$(env)-validation.nhsnlink.org/health
137163
138164 steps :
139165 - task : KubeloginInstaller@0
@@ -156,4 +182,25 @@ jobs:
156182 kubernetesCluster : ' $(kube_clustername)'
157183 namespace : ' $(kube_namespace)'
158184 command : set
159- arguments : ' image -n $(kube_namespace) deployment $(serviceName)-deploy $(containerName)=$(containerRegistry)/link-$(repoName):$(Build.SourceBranchName)-$(GIT_COMMIT)'
185+ arguments : ' image -n $(kube_namespace) deployment $(serviceName)-deploy $(containerName)=$(containerRegistry)/link-$(repoName):$(Build.SourceBranchName)-$(GIT_COMMIT)'
186+
187+ - task : Bash@3
188+ displayName : ' Site Validation for $(serviceName)'
189+ inputs :
190+ targetType : ' inline'
191+ script : |
192+ echo "Starting health check for app..."
193+ URL="$(healthUrl)"
194+
195+ for i in {1..20}; do
196+ STATUS=$(curl -s -o /dev/null -w "%{http_code}" $URL)
197+ if [ "$STATUS" == "200" ]; then
198+ echo "Health check succeeded with HTTP $STATUS"
199+ exit 0
200+ fi
201+ echo "Attempt $i: App not healthy yet (HTTP $STATUS)"
202+ sleep 10
203+ done
204+
205+ echo "Application failed health check after 10 attempts."
206+ exit 1
0 commit comments