-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile_CNP
164 lines (141 loc) · 5.2 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
#!groovy
@Library("Infrastructure")
import uk.gov.hmcts.contino.GradleBuilder
def type = "java"
def product = "juror"
def component = "scheduler-execution"
def branchesToSync = []
def secrets = [
'juror-${env}': [
secret('app-insights-connection-string', 'app-insights-connection-string'),
secret('AppInsightsInstrumentationKey', 'azure.application-insights.instrumentation-key'),
secret('scheduler-execution-SECRET', 'SECRET'),
secret('scheduler-api-SECRET', 'SCHEDULER_SERVICE_SECRET'),
secret('pnc-SECRET', 'POLICE_NATIONAL_COMPUTER_CHECK_SERVICE_SECRET'),
secret('api-JWT-SECRET-BUREAU', 'JUROR_SERVICE_SECRET')
],
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[$class : 'AzureKeyVaultSecret',
secretType : 'Secret',
name : secretName,
version : '',
envVariable: envVar
]
}
GradleBuilder builder = new GradleBuilder(this, product)
withPipeline(type, product, component) {
loadVaultSecrets(secrets)
enableSlackNotifications('#juror-build-notices')
syncBranchesWithMaster(branchesToSync)
env.SCHEDULER_SERVICE_HOST = 'juror-scheduler-api.staging.platform.hmcts.net'
env.SCHEDULER_SERVICE_PORT = 443
env.SCHEDULER_SERVICE_SUBJECT = '[email protected]'
env.POLICE_NATIONAL_COMPUTER_CHECK_SERVICE_HOST = 'juror-pnc.staging.platform.hmcts.net'
env.POLICE_NATIONAL_COMPUTER_CHECK_SERVICE_PORT = 443
env.POLICE_NATIONAL_COMPUTER_CHECK_SERVICE_SUBJECT = '[email protected]'
env.JUROR_SERVICE_HOST = 'juror-api.staging.platform.hmcts.net'
env.JUROR_SERVICE_PORT = 443
afterAlways('test') {
builder.gradle('jacocoTestReport')
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/checkstyle",
reportFiles : "main.html",
reportName : "Checkstyle Main Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/checkstyle",
reportFiles : "test.html",
reportName : "Checkstyle Test Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/checkstyle",
reportFiles : "integrationTest.html",
reportName : "Checkstyle Integration Test Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/checkstyle",
reportFiles : "smokeTest.html",
reportName : "Checkstyle Smoke Test Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/checkstyle",
reportFiles : "functionalTest.html",
reportName : "Checkstyle Functional Test Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/pmd",
reportFiles : "main.html",
reportName : "PMD Main Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/pmd",
reportFiles : "test.html",
reportName : "PMD Test Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/pmd",
reportFiles : "integrationTest.html",
reportName : "PMD Integration Test Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/pmd",
reportFiles : "smokeTest.html",
reportName : "PMD Smoke Test Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/pmd",
reportFiles : "functionalTest.html",
reportName : "PMD Functional Test Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/tests/test",
reportFiles : "index.html",
reportName : "Unit Test Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/tests/integration",
reportFiles : "index.html",
reportName : "Integration Test Report"
]
}
afterFailure('test') {
junit '**/test-results/integration/*.xml'
}
}