-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-build.yml
154 lines (146 loc) · 4.76 KB
/
azure-pipelines-build.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
parameters:
- name: buildAppealsBoApi
displayName: Build Appeals BO API
type: boolean
default: true
- name: buildAppealsBoWeb
displayName: Build Appeals BO Web
type: boolean
default: true
- name: buildFunctions
displayName: Build All Functions
type: boolean
default: true
pr: none
trigger:
branches:
include:
- main
paths:
exclude:
- infrastructure
resources:
repositories:
- repository: templates
type: github
endpoint: Planning-Inspectorate
name: Planning-Inspectorate/common-pipeline-templates
ref: refs/tags/release/3.17.0
extends:
template: stages/wrapper_ci.yml@templates
parameters:
gitFetchDepth: 0
globalVariables:
- template: azure-pipelines-variables.yml@self
validationJobs:
- name: Run Linting & Tests
steps:
- template: ../steps/node_script.yml
parameters:
nodeVersion: 20
script: npm ci
- template: ../steps/node_script.yml
parameters:
nodeVersion: 20
script: npm run tscheck
environmentVariables:
TURBO_TEAM: $(TURBO_TEAM)
TURBO_API: $(TURBO_API)
- template: ../steps/node_script.yml
parameters:
nodeVersion: 20
script: npm run lint:js
- template: ../steps/node_script.yml
parameters:
nodeVersion: 20
script: npm run test
environmentVariables:
TURBO_TEAM: $(TURBO_TEAM)
TURBO_API: $(TURBO_API)
TURBO_TOKEN: $(TURBO_TOKEN)
- name: Build Appeals BO API
condition: >-
and(
succeeded(),
or(
and(
eq(variables['Build.Reason'], 'Manual'),
eq(${{ parameters.buildAppealsBoApi }}, 'true')
),
ne(variables['Build.Reason'], 'Manual')
)
)
dependsOn:
- Run Linting & Tests
steps:
- template: ../steps/azure_web_app_docker_build_push.yml@templates
parameters:
azurecrName: $(azurecrName)
dockerfilePath: $(Build.SourcesDirectory)/appeals/api/Dockerfile
repository: back-office/back-office-appeals-api
buildArgs:
- GIT_SHA=$(Build.SourceVersion)
- name: Build Appeals BO Web
condition: >-
and(
succeeded(),
or(
and(
eq(variables['Build.Reason'], 'Manual'),
eq(${{ parameters.buildAppealsBoWeb }}, 'true')
),
ne(variables['Build.Reason'], 'Manual')
)
)
dependsOn:
- Run Linting & Tests
steps:
- template: ../steps/azure_web_app_docker_build_push.yml@templates
parameters:
azurecrName: $(azurecrName)
dockerfilePath: $(Build.SourcesDirectory)/appeals/web/Dockerfile
repository: back-office/appeals-web
buildArgs:
- GIT_SHA=$(Build.SourceVersion)
- name: Build All Functions
condition: >-
and(
succeeded(),
or(
and(
eq(variables['Build.Reason'], 'Manual'),
eq(${{ parameters.buildFunctions }}, 'true')
),
ne(variables['Build.Reason'], 'Manual')
)
)
dependsOn:
- Run Linting & Tests
steps:
# install only function deps
- template: ../steps/node_script.yml
parameters:
nodeVersion: 20
script: npm ci --only=prod --workspace=@pins/functions-bo-appeals-casedata-import --workspace=@pins/functions-bo-appeals-user-import --workspace=@pins/functions-bo-appeals-document-processing
# merge node modules
- template: azure-pipelines-package-function-merge.yml@self
parameters:
appealsFolderNames:
- 'casedata-import'
- 'user-import'
- 'document-processing'
# package Appeals BO case data function
- template: azure-pipelines-package-function.yml@self
parameters:
root: 'appeals'
folderName: 'casedata-import'
# package Appeals BO user function
- template: azure-pipelines-package-function.yml@self
parameters:
root: 'appeals'
folderName: 'user-import'
# package Appeals BO document function
- template: azure-pipelines-package-function.yml@self
parameters:
root: 'appeals'
folderName: 'document-processing'