forked from ordercloud-api/headstart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
194 lines (175 loc) · 5.82 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
resources:
repositories:
- repository: self
type: git
ref: development
jobs:
- job: Build_MiddleWare
pool:
vmImage: windows-2019
displayName: Build Middleware
steps:
- checkout: self
- template: version.yml
- task: NuGetToolInstaller@1
displayName: "Use NuGet"
- task: NuGetCommand@2
inputs:
command: 'restore'
restoreSolution: '**/*.sln'
feedsToUse: 'config'
nugetConfigPath: 'nuget.config'
displayName: "NuGet Restore"
- task: NuGetCommand@2
inputs:
command: 'restore'
restoreSolution: 'src/Middleware/src/SitecoreExtensions/code/Sitecore.Foundation.SitecoreExtensions.sln'
feedsToUse: 'config'
nugetConfigPath: 'nuget.config'
displayName: "Sitecore NuGet Restore"
- task: PowerShell@2
inputs:
filePath: 'headstart-sitecore-foundation-automation-deploy.ps1'
displayName: "Sitecore NuGet Packages Sync"
- task: CmdLine@2
displayName: Azure Storage for tests
inputs:
script: >-
sqllocaldb create MSSQLLocalDB
sqllocaldb start MSSQLLocalDB
sqllocaldb info MSSQLLocalDB
"C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe" start
- task: VSBuild@1
displayName: Build solution src/Middleware/Headstart.sln
inputs:
solution: src/Middleware/Headstart.sln
- task: VSTest@2
displayName: Run C# Unit tests
inputs:
testAssemblyVer2: >-
**\*.tests.dll
!**\obj\**
- task: DotNetCoreCLI@2
displayName: Build Jobs
inputs:
projects: '**/Headstart.Jobs.csproj'
arguments: '--configuration Release'
- task: DotNetCoreCLI@2
displayName: 'Publish Jobs'
inputs:
command: publish
publishWebProjects: false
projects: '**/Headstart.Jobs.csproj'
arguments: '--configuration Release --output jobs'
zipAfterPublish: false
- task: DotNetCoreCLI@2
displayName: Build Middleware
inputs:
projects: "**/Headstart.API.csproj"
arguments: --configuration Release
- task: DotNetCoreCLI@2
displayName: Publish Middleware
inputs:
command: publish
publishWebProjects: false
projects: "**/Headstart.API.csproj"
arguments: --configuration Release --output middleware
zipAfterPublish: false
- task: PublishBuildArtifacts@1
displayName: "Publish Artifact: Middleware"
inputs:
PathtoPublish: middleware
ArtifactName: middleware
- task: PublishBuildArtifacts@1
displayName: 'Publish Jobs Artifacts'
inputs:
PathtoPublish: jobs
ArtifactName: jobs
- job: Build_Buyer
pool:
vmImage: windows-2019
displayName: Build Buyer
steps:
- task: NodeTool@0
displayName: 'Use Node 16.x'
inputs:
versionSpec: 16.x
- task: Cache@2
displayName: 'SDK Dependencies Cache'
inputs:
key: 'npm | sdk | "$(Agent.OS)" | src/UI/SDK/package.json | v2'
path: 'src/UI/SDK/node_modules'
cacheHitVar: SDKCacheRestored
- task: Npm@1
displayName: 'Install SDK Dependencies'
inputs:
workingDir: src/UI/SDK
verbose: false
condition: ne(variables['SDKCacheRestored'], 'true')
- script: 'npm run build'
workingDirectory: src/UI/SDK
displayName: 'Build SDK'
- task: Cache@2
displayName: 'Buyer Dependencies Cache'
inputs:
key: 'npm | buyer | "$(Agent.OS)" | src/UI/Buyer/package-lock.json | src/UI/Buyer/package.json | src/UI/SDK/files-changed-hash | v2'
path: 'src/UI/Buyer/node_modules'
cacheHitVar: BuyerCacheRestored
- task: Npm@1
displayName: 'Install Buyer Dependencies'
inputs:
workingDir: src/UI/Buyer
verbose: false
condition: ne(variables['BuyerCacheRestored'], 'true')
- script: 'npm run preinstall && npm run build'
workingDirectory: src/UI/Buyer
displayName: 'Build Buyer'
- task: PublishBuildArtifacts@1
displayName: 'Publish Buyer Artifacts'
inputs:
PathtoPublish: 'src/UI/Buyer/dist'
ArtifactName: buyer
- job: Build_Seller
pool:
vmImage: windows-2019
displayName: Build Seller
steps:
- task: NodeTool@0
displayName: 'Use Node 16.x'
inputs:
versionSpec: 16.x
- task: Cache@2
displayName: 'SDK Dependencies Cache'
inputs:
key: 'npm | sdk | "$(Agent.OS)" | src/UI/SDK/package.json | v1'
path: 'src/UI/SDK/node_modules'
cacheHitVar: SDKCacheRestored
- task: Npm@1
displayName: 'Install SDK Dependencies'
inputs:
workingDir: src/UI/SDK
verbose: false
condition: ne(variables['SDKCacheRestored'], 'true')
- script: 'npm run build'
workingDirectory: src/UI/SDK
displayName: 'Build SDK'
- task: Cache@2
displayName: 'Seller Dependencies Cache'
inputs:
key: 'npm | seller | v2 | "$(Agent.OS)" | src/UI/Seller/package-lock.json | src/UI/Seller/package.json | src/UI/SDK/files-changed-hash | v1'
path: 'src/UI/Seller/node_modules'
cacheHitVar: SellerCacheRestoredV2
- task: Npm@1
displayName: 'Install Seller Dependencies'
inputs:
workingDir: src/UI/Seller
verbose: false
condition: ne(variables['SellerCacheRestoredV2'], 'true')
- script: 'npm run build'
workingDirectory: src/UI/Seller
displayName: 'Build Seller'
- task: PublishBuildArtifacts@1
displayName: 'Publish Seller Artifacts'
inputs:
PathtoPublish: src/UI/Seller/dist
ArtifactName: seller