-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
68 lines (63 loc) · 1.52 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
pipeline {
agent any
environment {
APP_NAME = 'multivideo'
SCARF_ANALYTICS = 'false'
}
tools {
nodejs 'nodejs 16.x'
}
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr:'5', daysToKeepStr: '5'))
timeout(time: 10, unit: 'MINUTES')
}
stages {
stage("npm") {
when {
anyOf {
changeset "package-lock.json"
expression {
fileExists("node_modules") == false
}
}
}
steps {
sh 'npm ci --silent'
}
}
stage("tests") {
parallel {
stage("lint") {
steps {
sh 'npm run lint'
}
}
stage("test") {
steps {
sh 'rm -rf coverage/'
sh 'npm run test'
cobertura autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'coverage/cobertura.xml', conditionalCoverageTargets: '70, 0, 0', failUnhealthy: false, failUnstable: false, lineCoverageTargets: '80, 0, 0', maxNumberOfBuilds: 0, methodCoverageTargets: '80, 0, 0', onlyStable: false
}
}
}
}
stage('sonarqube') {
environment {
scannerHome = tool 'sonarscanner'
}
steps {
withSonarQubeEnv('sonarqube.sonarqube.svc.dv.cluster.local') {
sh "${scannerHome}/bin/sonar-scanner"
}
}
}
stage("quality gate") {
steps {
timeout(time: 10, unit: 'MINUTES') {
waitForQualityGate abortPipeline: true
}
}
}
}
}