-
Notifications
You must be signed in to change notification settings - Fork 5
/
azure-pipelines.yml
128 lines (116 loc) · 4.03 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
trigger:
batch: true
branches:
include:
- "master"
variables:
- group: BUILD Management Resources
- group: ESFA - SonarCloud
- name: buildConfiguration
value: 'release'
- name: buildPlatform
value: 'anycpu'
resources:
repositories:
- repository: das-platform-building-blocks
type: github
name: SkillsFundingAgency/das-platform-building-blocks
ref: refs/tags/2.1.28
endpoint: SkillsFundingAgency
stages:
- stage: Build
jobs:
- job: 'CodeBuild'
pool:
name: DAS - Continuous Integration Agents
demands: LATEST_DOTNET_VERSION -equals 3.1
workspace:
clean: all
steps:
- template: azure-pipelines-templates/build/step/gitversion.yml@das-platform-building-blocks
- template: azure-pipelines-templates/build/step/app-build.yml@das-platform-building-blocks
parameters:
SonarCloudProjectKey: SkillsFundingAgency_das-apply-service
ContinueOnVulnerablePackageScanError: true
- task: DotNetCoreCLI@2
displayName: 'dotnet pack'
inputs:
command: pack
packagesToPack: 'src/SFA.DAS.ApplyService.Types/SFA.DAS.ApplyService.Types.csproj'
versioningScheme: byBuildNumber
packDirectory: $(build.artifactstagingdirectory)/NugetPackages
- task: DotNetCoreCLI@2
displayName: 'Publish Website'
inputs:
command: publish
publishWebProjects: false
projects: 'src/SFA.DAS.ApplyService.Web/SFA.DAS.ApplyService.Web.csproj'
arguments: '--configuration $(buildConfiguration) --output $(build.artifactstagingdirectory)/publish --no-restore --no-build'
- task: DotNetCoreCLI@2
displayName: 'Publish API'
inputs:
command: publish
publishWebProjects: false
projects: 'src/SFA.DAS.ApplyService.InternalApi/SFA.DAS.ApplyService.InternalApi.csproj'
arguments: '--configuration $(buildConfiguration) --output $(build.artifactstagingdirectory)/publish --no-restore --no-build'
- task: CopyFiles@2
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
inputs:
contents: |
azure/**
targetFolder: '$(build.artifactstagingdirectory)/publish'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
pathtoPublish: '$(build.artifactstagingdirectory)/publish'
- publish: $(build.artifactstagingdirectory)/NugetPackages
artifact: NugetPackages
- job: 'DACPACBuild'
pool:
vmImage: 'windows-2019'
workspace:
clean: all
steps:
- task: VSBuild@1
displayName: 'Build DACPAC'
inputs:
solution: 'src/SFA.DAS.ApplyService.Database/SFA.DAS.ApplyService.Database.sqlproj'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
msbuildArgs: '/p:PackageLocation="$(build.artifactstagingdirectory)/publish"'
- task: CopyFiles@2
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
inputs:
contents: |
src/**/*.dacpac
targetFolder: '$(build.artifactstagingdirectory)/publish'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
pathtoPublish: '$(build.artifactstagingdirectory)/publish'
- stage: NugetPublish
displayName: 'Publish Nuget Package'
pool:
name: 'DAS - Continuous Deployment Agents'
condition: and(succeeded(), eq(variables['Build.Reason'], 'Manual'))
jobs:
- job: 'CleanArtifacts'
displayName: Clean artifacts directory
workspace:
clean: all
- deployment: 'NugetPush'
dependsOn: 'CleanArtifacts'
environment: 'Nuget'
strategy:
runOnce:
deploy:
steps:
- download: current
artifact: NugetPackages
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
packagesToPush: '$(Pipeline.Workspace)/NugetPackages/*.nupkg;!$(Pipeline.Workspace)/NugetPackages/*.symbols.nupkg'
nuGetFeedType: external
publishFeedCredentials: 'SFA NuGet'