forked from ordercloud-api/headstart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
166 lines (151 loc) · 4.87 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
resources:
repositories:
- repository: self
type: git
ref: development
jobs:
- job: Build_MiddleWare
pool:
vmImage: windows-2022
displayName: Build Middleware
steps:
- checkout: self
- template: version.yml
- task: NuGetToolInstaller@1
displayName: "Use NuGet "
- task: NuGetCommand@2
displayName: NuGet restore
- 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-2022
displayName: Build Buyer
steps:
- task: NodeTool@0
displayName: 'Use Node 14.x'
inputs:
versionSpec: 14.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-2022
displayName: Build Seller
steps:
- task: NodeTool@0
displayName: 'Use Node 14.x'
inputs:
versionSpec: 14.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