-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jenkinsfile_CNP
204 lines (172 loc) · 6.21 KB
/
Jenkinsfile_CNP
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
195
196
197
198
199
200
201
202
203
#!groovy
properties([
[
$class : 'GithubProjectProperty',
displayName : 'Approve Organisations app',
projectUrlStr: 'https://github.com/hmcts/rpx-xui-approve-org'
],
pipelineTriggers([
[$class: 'GitHubPushTrigger']
])
])
@Library("Infrastructure")
import uk.gov.hmcts.contino.AppPipelineDsl
import uk.gov.hmcts.contino.azure.KeyVault
import uk.gov.hmcts.contino.Environment
def type = "nodejs"
def product = "xui"
def component = "ao-webapp"
def vault = "rpx"
def channel = '#xui-pipeline'
def yarnBuilder = new uk.gov.hmcts.contino.YarnBuilder(this)
def branchesToSync = ['demo', 'perftest', 'ithc']
def secrets = [
'rpx-${env}': [
secret('ao-test-email', 'TEST_EMAIL'),
secret('ao-test-password', 'TEST_PASSWORD'),
secret('test-api-email-adminuser', 'TEST_API_EMAIL_ADMIN'),
secret('test-api-password-adminuser', 'TEST_API_PASSWORD_ADMIN'),
secret('appinsights-instrumentationkey-ao', 'APPINSIGHTS_INSTRUMENTATIONKEY'),
secret('ao-s2s-client-secret', 'S2S_SECRET'),
secret('ao-idam-client-secret', 'IDAM_SECRET'),
secret('launch-darkly-client-id', 'LAUNCH_DARKLY_CLIENT_ID'),
secret('ao-webapp-redis6-connection-string', 'REDISCLOUD_URL'),
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
withPipeline(type, product, component) {
enableSlackNotifications(channel)
loadVaultSecrets(secrets)
enableAksStagingDeployment()
disableLegacyDeployment()
syncBranchesWithMaster(branchesToSync)
enablePactAs([
AppPipelineDsl.PactRoles.CONSUMER,
])
afterSuccess('build') {
yarnBuilder.yarn('build')
}
afterSuccess('test') {
publishHTML ( [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "reports/tests/coverage/node",
reportFiles : "index.html",
reportName : "node coverage tests"
])
publishHTML ( [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "reports/tests/coverage/ng",
reportFiles : "index.html",
reportName : "ng coverage tests"
])
publishHTML([
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "reports/tests/mutation/node/",
reportFiles : 'index.html',
reportName : 'XUI Approve Organisation Mutation tests'
])
publishHTML([
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "reports/tests/a11y/",
reportFiles : 'Report.html',
reportName : 'Approve Org a11y Test Report'
])
}
afterSuccess('smoketest:demo') {
publishHTML([
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "reports/tests/smoke/",
reportFiles : 'index.html',
reportName : 'DEMO Smoke Test'
])
}
afterSuccess('smoketest:preview') {
publishHTML([
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "reports/tests/smoke/",
reportFiles : 'index.html',
reportName : 'PREVIEW Smoke Test'
])
}
afterSuccess('functionalTest:preview') {
publishHTML([
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "reports/tests/api_functional/",
reportFiles : 'mochawesome.html',
reportName : 'PREVIEW API Functional Test'
])
publishHTML([
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "reports/tests/functional/",
reportFiles : 'index.html',
reportName : 'PREVIEW Functional Test'
])
publishHTML([
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "reports/tests/ngIntegration/",
reportFiles : 'index.html',
reportName : 'PREVIEW NG Integration Test'
])
}
afterSuccess('smoketest:aat') {
publishHTML([
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "reports/tests/smoke/",
reportFiles : 'index.html',
reportName : 'AAT Smoke Test'
])
}
afterSuccess('functionalTest:aat') {
publishHTML([
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "reports/tests/api_functional/",
reportFiles : 'mochawesome.html',
reportName : 'AAT API Functional Test'
])
publishHTML([
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "reports/tests/functional/",
reportFiles : 'index.html',
reportName : 'AAT Functional Test'
])
publishHTML([
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "reports/tests/ngIntegration/",
reportFiles : 'index.html',
reportName : 'AAt NG Integration Test'
])
}
}