modified jenkinsfile to work with node
Some checks failed
gitea/abap_tutorial_11/pipeline/head There was a failure building this commit
Some checks failed
gitea/abap_tutorial_11/pipeline/head There was a failure building this commit
This commit is contained in:
44
Jenkinsfile
vendored
Normal file
44
Jenkinsfile
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
tools {
|
||||
nodejs 'nodejs-latest' // Jenkins global tool name for Node.js
|
||||
}
|
||||
|
||||
environment {
|
||||
SONARQUBE_SCANNER = tool 'sonarqube' // Jenkins global tool name for SonarQube Scanner
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('SonarQube Analysis') {
|
||||
steps {
|
||||
withSonarQubeEnv('sonarqubeserer') {
|
||||
sh """
|
||||
${SONARQUBE_SCANNER}/bin/sonar-scanner \\
|
||||
-Dsonar.projectKey=abap-tutorial-11 \\
|
||||
-Dsonar.projectName="abap-tutorial-11" \\
|
||||
-Dsonar.sources=src \\
|
||||
-Dsonar.tests=test,tests,__tests__ \\
|
||||
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info \\
|
||||
-Dsonar.exclusions=node_modules/**,coverage/**,dist/**,build/** \\
|
||||
-Dsonar.testExecutionReportPaths=test-report.xml
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Quality Gate') {
|
||||
steps {
|
||||
timeout(time: 10, unit: 'MINUTES') {
|
||||
waitForQualityGate abortPipeline: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
cleanWs()
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user