Skip to content

Commit

Permalink
[#IP-417] Fix healthcheck stage (#168)
Browse files Browse the repository at this point in the history
* [#ip-417] upgrade azure-pipelines-templates to v17

* [#ip-417] move to new healthcheck management
  • Loading branch information
gquadrati authored Sep 30, 2021
1 parent 2408aa6 commit 757300e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .devops/code-review-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ resources:
- repository: pagopaCommons
type: github
name: pagopa/azure-pipeline-templates
ref: refs/tags/v15
ref: refs/tags/v17
endpoint: 'io-azure-devops-github-ro'

stages:
Expand Down
21 changes: 11 additions & 10 deletions .devops/deploy-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Azure DevOps pipeline to release a new version and deploy to production.

variables:
HEALTHCHECK_PATH: '/info'

parameters:
- name: 'RELEASE_SEMVER'
displayName: 'When packing a release, define the version bump to apply'
Expand Down Expand Up @@ -27,7 +30,7 @@ resources:
- repository: pagopaCommons
type: github
name: pagopa/azure-pipeline-templates
ref: refs/tags/v15
ref: refs/tags/v17
endpoint: 'pagopa'

stages:
Expand Down Expand Up @@ -129,20 +132,18 @@ stages:

# Check that the staging instance is healthy
- stage: Healthcheck
pool:
name: $(AGENT_POOL)
dependsOn:
- Deploy_staging
jobs:
- job: 'do_healthcheck'
steps:
- template: templates/rest-healthcheck/template.yaml@pagopaCommons
parameters:
azureSubscription: '$(PRODUCTION_AZURE_SUBSCRIPTION)'
appName: '$(PRODUCTION_APP_NAME)'
endpoint: 'https://$(PRODUCTION_APP_NAME)-staging.azurewebsites.net/info'
endpointType: 'private'
containerInstanceResourceGroup: 'io-p-rg-common'
containerInstanceVNet: 'io-p-vnet-common'
containerInstanceSubnet: 'azure-devops'
- checkout: none
- script: |
# fails if response status is not 2xx
curl -f 'https://$(PRODUCTION_APP_NAME)-staging.azurewebsites.net/$(HEALTHCHECK_PATH)'
displayName: 'Healthcheck'
# Promote the staging instance to production
- stage: Deploy_production
Expand Down

0 comments on commit 757300e

Please sign in to comment.