-
Notifications
You must be signed in to change notification settings - Fork 14
/
Jenkinsfile
85 lines (79 loc) · 1.85 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
pipeline {
agent any
tools {
nodejs "stable"
}
options {
timestamps()
skipDefaultCheckout true
overrideIndexTriggers false
buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '7', numToKeepStr: '10')
disableConcurrentBuilds()
}
triggers {
pollSCM("H/5 * * * *")
}
stages {
stage("Clean the workspace and checkout source") {
steps {
deleteDir()
checkout scm
}
}
stage ("Install Dependencies") {
steps {
sh "yarn"
}
}
stage ("Check Lint") {
steps {
sh "yarn lint"
}
}
stage ("Check Types") {
steps {
sh "yarn types"
}
}
stage ("Test Package") {
steps {
sh "yarn coverage"
}
}
}
post {
always {
echo 'Setting the build version'
script {
def packageJson = readJSON file: "./package.json"
currentBuild.description = "[version] ${packageJson.version}"
}
echo 'Trying to publish the test report'
junit healthScaleFactor: 100.0, testResults: '**/coverage/junit.xml', allowEmptyResults: true
echo 'Trying to publish the code coverage report'
cobertura(
coberturaReportFile: '**/coverage/cobertura-coverage.xml',
failUnhealthy: false,
failNoReports: false,
failUnstable: false,
onlyStable: false,
zoomCoverageChart: false,
conditionalCoverageTargets: '70, 0, 0',
lineCoverageTargets: '70, 0, 0',
methodCoverageTargets: '70, 0, 0',
maxNumberOfBuilds: 0,
sourceEncoding: 'ASCII'
)
}
success {
echo "The force is strong with this one"
deleteDir()
}
unstable {
echo "Do or do not there is no try"
}
failure {
echo "The dark side I sense in you."
}
}
}