Commit dcbe0cc7 authored by Luca Verardo's avatar Luca Verardo
Browse files

Added SonarCloud quality code testing

parent 929233bb
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ pipeline {
                        }

                        docker.image('maven:3-alpine').inside("--link ${c.id}:db") {
                            /* Wait until mysql service is up */
                            checkout scm
                            sh 'mv src/main/resources/application.properties.production src/main/resources/application.properties'
                            sh 'mvn test'
                        }
@@ -44,5 +44,16 @@ pipeline {
                }
            }
        }
        stage('Quality'){
            steps{
                withCredentials([usernamePassword(credentialsId: 'SonarCloud_Zegorax_Token', passwordVariable: 'SONARCLOUD_API_TOKEN', usernameVariable: 'SONARCLOUD_API_USER')]) {
                    docker.image('maven:3-alpine').inside() {
                            checkout scm
                            sh 'mv src/main/resources/application.properties.production src/main/resources/application.properties'
                            sh 'mvn verify sonar:sonar'
                    }
                }
            }
        }
    }
}
 No newline at end of file
+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,10 @@

	<properties>
		<java.version>1.8</java.version>
		<sonar.projectKey>Zegorax_MentorArc</sonar.projectKey>
  		<sonar.organization>${env.SONARCLOUD_API_USER}</sonar.organization>
 		<sonar.host.url>https://sonarcloud.io</sonar.host.url>
  		<sonar.login>${env.SONARCLOUD_API_TOKEN}</sonar.login>
	</properties>

	<dependencies>