modified jenkinsfile to work with node
Some checks failed
gitea/abap_tutorial_11/pipeline/head There was a failure building this commit

This commit is contained in:
2025-04-25 22:30:28 +02:00
parent 777a29d3bc
commit 9650577cf1

44
Jenkinsfile vendored Normal file
View 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()
}
}
}