-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
135 lines (125 loc) · 4.55 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
trigger:
batch: true
branches:
include:
- master
paths:
exclude:
- README.md
- images/*
pr: none
pool:
vmImage: 'windows-latest'
resources:
- repo: self
variables:
- group: tdi-base
- name: solution
value: '**/TechnicalDocuIndexer.sln'
- name: buildPlatform
value: 'Any CPU'
- name: buildConfiguration
value: 'Release'
stages:
- stage: Build
displayName: Build Solution
jobs:
- job: Build
displayName: Build
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: DotNetCoreCLI@2
inputs:
command: 'publish'
publishWebProjects: true
arguments: '--configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/webapp'
- publish: $(build.artifactstagingdirectory)/webapp
artifact: webapp
- task: DotNetCoreCLI@2
inputs:
command: 'publish'
publishWebProjects: false
projects: '**/TechnicalDocuIndexer.Functions.csproj'
arguments: '--output $(Build.BinariesDirectory)/functions --configuration Release'
- publish: $(build.artifactstagingdirectory)/functions
artifact: functions
- job: Test
dependsOn: Build
displayName: Run Tests
steps:
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- job: publishArmArtifact
dependsOn:
- Build
- Test
displayName: Publish ARM artifact
steps:
- publish: $(System.DefaultWorkingDirectory)/infrastructure
artifact: ARMTemplate
- stage: DeployAzureResources
dependsOn: Build
displayName: Deploy Azure Web App Resource
jobs:
- deployment: deployment
environment: dev
strategy:
runOnce:
deploy:
steps:
- download: current
artifact: ARMTemplate
- task: AzureResourceManagerTemplateDeployment@3
name: 'Deploy_Azure_Webapp_for_Windows'
displayName: 'Deploy Azure Webapp for Windows'
inputs:
deploymentScope: 'Resource Group'
azureResourceManagerConnection: $(Azure.Resource.Manager.Connection)
subscriptionId: $(Azure.Subscription.Id)
action: 'Create Or Update Resource Group'
resourceGroupName: "$(Resource.Group.Name)"
location: 'West Europe'
templateLocation: 'Linked artifact'
csmFile: '$(Pipeline.Workspace)/ARMTemplate/template.json'
csmParametersFile: '$(Pipeline.Workspace)/ARMTemplate/parameters.json'
deploymentMode: 'Incremental'
overrideParameters: -Auth0SettingsAudience $(Auth0Settings.Audience) -Auth0SettingsClientId $(Auth0Settings.ClientId) -Auth0SettingsClientSecret $(Auth0Settings.ClientSecret) -Auth0SettingsDomain $(Auth0Settings.Domain) -searchServiceName $(Search.Service) -SearchAPIKey $(Search.APIKey) -SearchIndexName $(Search.IndexName) -SearchQueryKey $(Search.QueryKey)
- stage: DeploySolution
dependsOn: DeployAzureResources
displayName: Deploy solution
jobs:
- deployment: solution
environment: dev
strategy:
runOnce:
deploy:
steps:
- download: current
artifact: webapp
- task: AzureRmWebAppDeployment@4
inputs:
ConnectionType: 'AzureRM'
azureSubscription: $(Azure.Resource.Manager.Connection)
appType: 'webApp'
WebAppName: 'TechnicalDocuIndexerWeb'
packageForLinux: '$(Pipeline.Workspace)/webapp/*.zip'
- download: current
artifact: functions
- task: AzureFunctionApp@1
inputs:
azureSubscription: $(Azure.Resource.Manager.Connection)
appType: 'functionApp'
appName: 'func-tdi-custom-skills'
package: '$(Pipeline.Workspace)/functions/*.zip'
deploymentMethod: 'auto'