diff --git a/jenkins b/jenkins new file mode 100644 index 000000000..c16b82aca --- /dev/null +++ b/jenkins @@ -0,0 +1,42 @@ +pipeline{ + agent any + stages{ + stage("git code"){ + steps{ + git url: "https://github.com/kallepallinaveen/spring-framework-petclinic.git", branch:"prod" + } + + } + stage("build code"){ + steps{ + sh "mvn clean install" + + } + + } + stage("test code"){ + steps{ + sh "mvn test" + + } + + } + stage("Sonarqube Analysis"){ + environment { + def scannerHome = tool 'SonarQube Scanner 2.4' + } + steps{ + withSonarQubeEnv('sonarqube-scanner'){ + sh "${scannerHome}/bin/sonar-scanner" + } + } + sleep time: 30000, unit: 'MILLISECONDS' + script { + def qg = waitForQualityGate() + if (qg.status != 'OK') { + error "Pipeline aborted due to quality gate failure: ${qg.status}" + } + } + } + } +} diff --git a/sonar.properties b/sonar.properties new file mode 100644 index 000000000..c27b3d935 --- /dev/null +++ b/sonar.properties @@ -0,0 +1,14 @@ +# must be unique in a given SonarQube instance +sonar.projectKey=sonar-scanning-examples +# --- optional properties --- +# defaults to project key +sonar.projectName=Naveen-pet-clinic-app +# defaults to 'not provided' +sonar.projectVersion=1.0 +# Path is relative to the sonar-project.properties file. Defaults to . +sonar.sources=. +# Encoding of the source code. Default is default system encoding +sonar.sourceEncoding=UTF-8 +sonar.host.url=http://7ba2808d972d.mylabserver.com:8000 +sonar.java.binaries=./target/classes +sonar.login=a9401dc2d990013650b395a3d845fe7fede92e59 \ No newline at end of file diff --git a/spring-framework-petclinic b/spring-framework-petclinic new file mode 160000 index 000000000..9aeddaf9a --- /dev/null +++ b/spring-framework-petclinic @@ -0,0 +1 @@ +Subproject commit 9aeddaf9a49fce3cf78c1371abd97675e2f59072