-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathazure-pipelines.sds.pr-close.yml
80 lines (70 loc) · 2.63 KB
/
azure-pipelines.sds.pr-close.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: $(Date:yyyyMMddHHmm)-$(Rev:r)
resources:
repositories:
- repository: azTemplates
type: github
name: hmcts/azure-devops-templates
ref: master
endpoint: hmcts
pool:
vmImage: ubuntu-22.04
pr: none
trigger: none
variables:
- group: vh-github-app-credentials
parameters:
- name: prNumber
displayName: Pull Request Number
type: string
stages:
- stage: uninstall_dev
displayName: Uninstall Dev Helm and DNS
dependsOn: []
variables:
- template: variables/dev.yaml
- template: variables/shared.yaml
parameters:
env: ${{ variables.env }}
prNumber: ${{ parameters.prNumber }}
- name: dnsRecordName
value: vh-${{ variables.git_repo_name }}-${{ variables.prTagPrefix }}
- group: vh-tenant-creds
jobs:
- job: helm_uninstall
displayName: Uninstall Helm from Dev
steps:
- template: templates\Azure\Aks\get-active-cluster.yaml@azTemplates
parameters:
subscriptionName: "${{ variables.subscriptionName }}"
environment: ${{ variables.env }}
- bash: |
echo "$(appName)"
- template: templates/Containerisation/helm/helm-uninstall.yaml@azTemplates
parameters:
namespace: 'vh'
releaseName: "${{ variables.chartName }}-${{ variables.prTagPrefix }}"
azureSubscription: "${{ variables.subscriptionName }}"
aksResourceGroupName: "$(aksCluster.resourceGroup)"
aksClusterName: "$(aksCluster.name)"
- job: dns_uninstall
displayName: Uninstall DNS from Dev
steps:
- template: templates\Azure\Dns\private-dns-remove.yaml@azTemplates
parameters:
subscriptionName: "${{ variables.subscriptionName }}"
dnsSubscriptionName: "${{ variables.dnsZoneSubscription }}"
dnsResourceGroupName: "${{ variables.dnsZoneResourceGroup }}"
zoneName: ${{ variables.dnsZone }}
recordName: ${{ variables.dnsRecordName }}
- job: redirect_url_remove
displayName: Remove AAD Redirect Url
steps:
- template: templates\Azure\AAD\apps\add-remove-replyruls--no-sc.yaml@azTemplates
parameters:
azureClientId: $(vh_client_id)
azureClientSecret: $(vh_client_secret)
azureTenant: $(vh_tenant_id)
action: "remove"
domain: "https://${{ variables.dnsRecordName }}.${{ variables.dnsZone }}"
name: "a${{ variables.gitRepoName }}.${{ variables.dnsZone }}"
domainUris: ${{ variables.app_redirect_uri }}