mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 15:25:49 +00:00
Add files via upload
This commit is contained in:
parent
516722647a
commit
034915a517
2 changed files with 63 additions and 0 deletions
53
jenkinsfile
Normal file
53
jenkinsfile
Normal file
|
@ -0,0 +1,53 @@
|
|||
pipeline {
|
||||
agent any
|
||||
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
// Checkout code from Git repository
|
||||
checkout scm
|
||||
}
|
||||
}
|
||||
|
||||
stage('SonarQube Code Analysis') {
|
||||
steps {
|
||||
dir("${WORKSPACE}"){
|
||||
// Run SonarQube analysis for Angular
|
||||
script {
|
||||
def scannerHome = tool name: 'angular-demo', type: 'hudson.plugins.sonar.SonarRunnerInstallation'
|
||||
withSonarQubeEnv('sonar') {
|
||||
sh "echo $pwd"
|
||||
sh "${scannerHome}/bin/sonar-scanner"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("SonarQube Quality Gate Check") {
|
||||
steps {
|
||||
script {
|
||||
def qualityGate = waitForQualityGate()
|
||||
|
||||
if (qualityGate.status != 'OK') {
|
||||
echo "${qualityGate.status}"
|
||||
error "Quality Gate failed: ${qualityGateStatus}"
|
||||
}
|
||||
else {
|
||||
echo "${qualityGate.status}"
|
||||
echo "SonarQube Quality Gates Passed"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('AWS Lambda'){
|
||||
steps {
|
||||
invokeLambda([awsRegion: 'us-east-1',
|
||||
functionName: '7ops_GetSonarqube_SendS3',
|
||||
payload: "{ \"Suspend\": \"true\"}] }",
|
||||
synchronous: true,
|
||||
useInstanceCredentials: true])
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
10
sonar-project.properties
Normal file
10
sonar-project.properties
Normal file
|
@ -0,0 +1,10 @@
|
|||
# sample file
|
||||
sonar.projectKey=angular-demo
|
||||
sonar.projectName=angular-demo
|
||||
sonar.sources=./
|
||||
# sonar.exclusions=**/*.css,**/*.html
|
||||
sonar.typescript.tsconfigPaths=./**/tsconfig.json
|
||||
# sonar.javascript.lcov.reportPaths=./analysis/coverage/lcov.info
|
||||
# sonar.language=ts
|
||||
# sonar.inclusions=**/*.ts
|
||||
sonar.sourceEncoding=UTF-8
|
Loading…
Reference in a new issue