-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
61 lines (61 loc) · 1.37 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
pipeline {
agent { dockerfile true }
environment {
MAIN_BRANCH = 'master'
BUILD_NAME = 'kdmf'
}
stages {
stage('build') {
steps {
script {
sh 'npm i'
sh 'npm run build'
}
}
}
stage('test') {
steps {
script {
// run the command to run tests with the sh command
sh 'npm run test-coverage-headless'
}
}
post {
always {
// if the testing command creates a test report, parse it with the junit command
junit 'config/coverage/**/*.xml'
script {
publishHTML (target: [
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: 'coverage',
reportFiles: 'index.html',
reportName: "Coverage Report"
])
}
}
}
}
stage('e2e') {
steps {
script {
// run the command to run tests with the sh command
sh 'npm run e2e'
}
}
post {
always {
// if the testing command creates a test report, parse it with the junit command
junit 'coverage/e2e/*.xml'
}
}
}
// Example used: https://github.com/JFrogDev/project-examples/blob/master/jenkins-pipeline-examples/declarative-example/Jenkinsfile
}
post {
always {
deleteDir()
}
}
}