-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
62 lines (46 loc) · 1.39 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
node() {
try{
stage('Cleaning Workspace') {
echo 'Initializing for clean build...'
deleteDir()
}
stage('Initialize') {
echo 'Initializing...'
def node = tool name: 'NodeJS-8.11.3', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'
env.PATH = "${node}/bin:${env.PATH}"
}
stage('Checkout SCM') {
echo 'Checkout SCM...'
checkout scm
}
try{
stage('Check Env') {
echo 'Checking Environment...'
sh 'node -v'
sh 'npm -v'
}
stage('Build') {
echo 'Building Dependency...'
sh 'npm install'
}
stage('Testing'){
echo 'Testing...'
sh 'npm test'
sh 'npm run bdd'
}
}finally{
stage('Reporting') {
junit ' **/*.xml'
step([$class: 'CukedoctorPublisher', featuresDir: '', format: 'HTML', hideFeaturesSection: false, hideScenarioKeyword: false, hideStepTime: false, hideSummary: false, hideTags: false, numbered: true, sectAnchors: true, title: 'Living Documentation', toc: 'RIGHT'])
}
stage('SonarQube analysis') {
def scannerHome = tool 'sonarqube-scanner';
withSonarQubeEnv('sonarqube') {
sh "${scannerHome}/bin/sonar-scanner"
}
}
}
}catch(e){
throw e;
}
}