forked from hmcts/em-native-pdf-annotator-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile_CNP
190 lines (169 loc) · 6.57 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
#!groovy
import uk.gov.hmcts.contino.AppPipelineDsl
properties([
[
$class: 'GithubProjectProperty',
displayName: 'Evidence NPA App',
projectUrlStr: 'https://github.com/hmcts/rpa-native-pdf-annotator-app'
],
pipelineTriggers([
[$class: 'GitHubPushTrigger']
])
])
@Library("Infrastructure")
def type = "java"
def product = "em"
def component = "npa"
def secrets = [
's2s-${env}': [
secret('microservicekey-em-gw', 'FUNCTIONAL_TEST_CLIENT_S2S_TOKEN')
],
'rpa-${env}': [
secret('show-oauth2-token', 'FUNCTIONAL_TEST_CLIENT_OAUTH_SECRET')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
// Vars for Kubernetes
env.IDAM_API_BASE_URI = 'https://idam-api.aat.platform.hmcts.net'
env.OPEN_ID_API_BASE_URI = 'https://idam-web-public.aat.platform.hmcts.net/o'
env.OIDC_ISSUER_BASE_URI = 'https://forgerock-am.service.core-compute-idam-aat.internal:8443/openam/oauth2/hmcts'
env.S2S_BASE_URI = 'http://rpe-service-auth-provider-aat.service.core-compute-aat.internal'
env.IDAM_WEBSHOW_WHITELIST = 'https://em-show-aat.service.core-compute-aat.internal/oauth2/callback'
env.DM_STORE_APP_URL = 'http://dm-store-aat.service.core-compute-aat.internal'
env.EM_ANNO_APP_URL = 'http://em-anno-aat.service.core-compute-aat.internal'
env.PACT_BROKER_FULL_URL = 'https://pact-broker.platform.hmcts.net'
def vaultOverrides = [
'preview' : 'aat',
'spreview': 'saat'
]
withPipeline(type , product, component) {
enableDbMigration('em-npa')
overrideVaultEnvironments(vaultOverrides)
loadVaultSecrets(secrets)
enableAksStagingDeployment()
disableLegacyDeployment()
onMaster {
after('test') {
sh '''
curl https://raw.githubusercontent.com/hmcts/reform-api-docs/master/bin/publish-swagger-docs.sh > publish-swagger-docs.sh
sh ./publish-swagger-docs.sh
'''
}
}
onMaster()
{
enablePactAs([AppPipelineDsl.PactRoles.CONSUMER])
}
after('test') {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/checkstyle",
reportFiles : "main.html",
reportName : "NPA API Checkstyle Main Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/checkstyle",
reportFiles : "test.html",
reportName : "NPA API Checkstyle Test Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/checkstyle",
reportFiles : "aat.html",
reportName : "NPA API Checkstyle AAT Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/checkstyle",
reportFiles : "contractTest.html",
reportName : "NPA API Checkstyle PACT Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/tests/test",
reportFiles : "index.html",
reportName : "NPA API Unit Tests Report"
]
}
after('smoketest:preview') {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/tests/smoke",
reportFiles : "index.html",
reportName : "NPA API Smoke Test Report"
]
}
after('smoketest:aat') {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/tests/smoke",
reportFiles : "index.html",
reportName : "NPA API Smoke Test Report"
]
}
after('functionalTest:preview') {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/tests/functional",
reportFiles : "index.html",
reportName : "NPA API Functional Test Report"
]
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/site/serenity/**/*'
}
after('functionalTest:aat') {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/tests/functional",
reportFiles : "index.html",
reportName : "NPA API Functional Test Report"
]
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/site/serenity/**/*'
}
after('pactconsumerVerification:preview') {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/tests/contract",
reportFiles : "index.html",
reportName : "NPA API Contract Test Report"
]
}
after('pactconsumerVerification:aat') {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/tests/contract",
reportFiles : "index.html",
reportName : "NPA API Contract Test Report"
]
}
syncBranchesWithMaster(['demo', 'perftest', 'ithc'])
}