-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathJenkinsfile_CNP
More file actions
44 lines (39 loc) · 1.45 KB
/
Jenkinsfile_CNP
File metadata and controls
44 lines (39 loc) · 1.45 KB
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
#!groovy
@Library("Infrastructure")
// Need to replace these with TCoE team once available
def type = "nodejs"
def product = "dtsse"
def component = "e2e-tests"
def channel = "#tcoe-builds"
def yarnBuilder = new uk.gov.hmcts.contino.YarnBuilder(this)
def archiveCoverageReports(yarnBuilder) {
// Best-effort: skips quietly if coverage or api specs are absent
try {
yarnBuilder.yarn('report:coverage')
yarnBuilder.yarn('report:api-endpoints')
archiveArtifacts allowEmptyArchive: true, artifacts: 'coverage/coverage-summary.txt'
archiveArtifacts allowEmptyArchive: true, artifacts: 'coverage/api-endpoints.json'
} catch (Error) {
unstable(message: "Coverage & endpoint archival is unstable: " + Error.toString())
}
}
/**
* As this repo is not a part of any service or application, withNightlyPipeline is used
* Typically, withPipeline would be used as it contains additional steps needed to release & deploy
* See https://github.com/hmcts/cnp-jenkins-library for more info on the opinionated pipeline
*/
withNightlyPipeline(type, product, component) {
enableSlackNotifications(channel)
afterAlways('DependencyCheckNightly') {
stage('Lint') {
try {
yarnBuilder.yarn('lint')
} catch (Error) {
unstable(message: "${STAGE_NAME} is unstable: " + Error.toString())
}
}
stage('Generate coverage & endpoint reports') {
archiveCoverageReports(yarnBuilder)
}
}
}