Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create sonar-project.properties #4

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
38 changes: 38 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// This adds a quality gate that aborts the pipeline if the quality threshold isn't met
pipeline {
agent any

stages {
stage('Checkout') {
steps {
// Get some code from a GitHub repository
git branch: 'main', url: 'https://github.com/XiaoyingHuang-Training/lbg-vat-calculator.git'
}
}
stage('Install') {
steps {
// Install the ReactJS dependencies
sh "npm install"
}
}
stage('Test') {
steps {
// Run the ReactJS tests
sh "npm test"
}
}
stage('SonarQube Analysis') {
environment {
scannerHome = tool 'sonarqube'
}
steps {
withSonarQubeEnv('sonar-qube-1') {
sh "${scannerHome}/bin/sonar-scanner"
}
timeout(time: 10, unit: 'MINUTES'){
waitForQualityGate abortPipeline: true
}
}
}
}
}
Loading