-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
67 lines (64 loc) · 1.61 KB
/
Jenkinsfile
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
library 'jenkins-ptcs-library@master'
podTemplate(label: pod.label,
containers: pod.templates + [
containerTemplate(
name: 'node',
image: 'node:10',
alwaysPullImage: true,
ttyEnabled: true,
command: '/bin/sh -c', args: 'cat',
resourceRequestMemory: '2200M',
)
]
) {
def project = 'pdf-template-builder'
def branch = (env.BRANCH_NAME)
node(pod.label) {
try {
stage('Checkout') {
checkout scm
}
stage('Build') {
container('node') {
sh """
npm install
npm run lib
"""
}
}
stage('Test') {
container('node') {
sh """
npm run test:ci
"""
}
}
stage('Publish on release') {
publishTagToNpm()
}
stage('Report') {
step([
$class: 'CloverPublisher',
cloverReportDir: 'coverage',
cloverReportFileName: 'clover.xml',
healthyTarget: [methodCoverage: 100, conditionalCoverage: 80, statementCoverage: 80],
unhealthyTarget: [methodCoverage: 45, conditionalCoverage: 45, statementCoverage: 45],
failingTarget: [methodCoverage: 0, conditionalCoverage: 0, statementCoverage: 0]
])
publishHTML(target: [
allowMissing: false,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'coverage/lcov-report',
reportFiles: 'index.html',
reportName: 'Code Coverage',
reportTitles: ''
])
}
}
catch (e) {
currentBuild.result = 'FAILED'
throw e
}
}
}