-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
196 lines (176 loc) · 5.79 KB
/
azure-pipelines.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yy)$(DayOfYear).$(BuildCounter)
parameters:
- name: ContinueEvenIfResourcesAreGettingDestroyed
displayName: "Continue even if resources are getting destroyed"
type: boolean
default: false
- name: disableStryker
displayName: "Disable Stryker"
type: boolean
default: false
- name: DisableDependencyCheck
displayName: "Disable OWASP dependency checking"
type: boolean
default: false
trigger:
- main
- release/*
- develop
schedules:
- cron: "0 4 * * 1"
displayName: "Weekly NVD Check Build"
branches:
include:
- main
always: true
pool:
name: NautilusBuild
demands: vs_16 -equals 1 #exclude agents 13 and 14 as code coverage report fails
variables:
- name: BuildConfiguration
value: "release"
- name: BuildPlatform
value: "any cpu"
- name: BuildCounter
value: $[counter(format('{0:yyyyMMdd}', pipeline.startTime), 1)]
- name: UKHOAssemblyCompany
value: "UK Hydrographic Office"
- name: UKHOAssemblyVersionPrefix
value: "1.0."
- name: UKHOAssemblyProduct
value: "Exchange Set Service"
- name: UKHOAssemblyCopyright
value: "Copyright � UK Hydrographic Office"
- name: Container
value: "ukhydrographicoffice/terraform-azure-powershell-unzip:1.9.6"
- name: DeploymentPool
value: "Mare Nectaris"
- name: SdkVersion
value: "8.0.x"
- name: WindowPool
value: "NautilusBuild"
resources:
repositories:
- repository: UKHOTemplates
type: github
name: UKHO/devops-pipelinetemplates
endpoint: UKHO
ref: refs/heads/main
stages:
- stage: Stryker_Mutator
displayName: "Stryker Mutator"
condition: ${{ eq(parameters.disableStryker, false) }}
dependsOn: []
jobs:
- job: Stryker
workspace:
clean: all
steps:
- task: UseDotNet@2
displayName: 'Use .NET SDK'
inputs:
packageType: sdk
version: $(SdkVersion)
- task: UseDotNet@2
displayName: 'Use .NET SDK for Stryker'
inputs:
packageType: sdk
version: $(SdkVersion)
- task: DotNetCoreCLI@2
displayName: "Install Stryker"
inputs:
command: custom
custom: tool
workingDirectory: $(Agent.TempDirectory)
arguments: install dotnet-stryker --tool-path $(Agent.BuildDirectory)/tools
- task: Powershell@2
displayName: "Run Stryker"
inputs:
workingDirectory: '$(Build.SourcesDirectory)\UKHO.ExchangeSetService.API'
targetType: 'inline'
pwsh: true
script: $(Agent.BuildDirectory)/tools/dotnet-stryker
- task: PublishMutationReport@1
displayName: 'Publish Stryker Mutator Report'
inputs:
reportPattern: '**/mutation-report.html'
- stage: BuildTestPublish
displayName: "Build, test and publish"
dependsOn: []
jobs:
- template: Deployment/templates/build-test-publish.yml
parameters:
DisableDependencyCheck: ${{ parameters.DisableDependencyCheck }}
DotNetVersion: '8.0.x'
- stage: Devdeploy
dependsOn:
- BuildTestPublish
displayName: "Dev deploy (inc terraform, webapp deploy)"
jobs:
- template: Deployment/templates/app-deploy.yml
parameters:
Environment: "dev"
ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }}
AzureSubscription: ""
Container: ${{variables.Container}}
RunTests: true
- stage: vNextIatdeploy
dependsOn:
- Devdeploy
displayName: "vNextIat Deploy (inc terraform, webapp deploy)"
jobs:
- template: Deployment/templates/app-deploy.yml
parameters:
Environment: "vnextiat"
ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }}
AzureSubscription: ""
Container: ${{variables.Container}}
RunTests: false
- stage: vNextE2Edeploy
dependsOn:
- vNextIatdeploy
displayName: "vNextE2E Deploy (inc terraform, webapp deploy)"
jobs:
- template: Deployment/templates/app-deploy.yml
parameters:
Environment: "vnexte2e"
ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }}
AzureSubscription: ""
Container: ${{variables.Container}}
RunTests: false
- stage: IATdeploy
dependsOn:
- Devdeploy
displayName: "IAT Deploy (inc terraform, webapp deploy)"
jobs:
- template: Deployment/templates/app-deploy.yml
parameters:
Environment: "iat"
ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }}
AzureSubscription: ""
Container: ${{variables.Container}}
RunTests: false
- stage: PreProddeploy
dependsOn:
- IATdeploy
displayName: "PreProd Deploy (inc terraform, webapp deploy)"
jobs:
- template: Deployment/templates/app-deploy.yml
parameters:
Environment: "iat"
ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }}
AzureSubscription: ""
Container: ${{variables.Container}}
RunTests: false
- stage: Livedeploy
dependsOn:
- PreProddeploy
displayName: "Live Deploy (inc terraform, webapp deploy)"
jobs:
- template: Deployment/templates/app-deploy.yml
parameters:
Environment: "iat"
ContinueEvenIfResourcesAreGettingDestroyed: ${{ parameters.ContinueEvenIfResourcesAreGettingDestroyed }}
AzureSubscription: ""
Container: ${{variables.Container}}
RunTests: false