Loading Jenkinsfile +21 −1 Original line number Diff line number Diff line Loading @@ -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' } Loading @@ -44,5 +44,25 @@ pipeline { } } } stage('Quality'){ steps{ script{ withCredentials([usernamePassword(credentialsId: 'SonarCloud_Zegorax_Token', passwordVariable: 'SONARCLOUD_API_TOKEN', usernameVariable: 'SONARCLOUD_API_USER')]) { docker.image('mysql').withRun('-e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=mentorarc -e MYSQL_USER=mentorarc -e MYSQL_PASSWORD=mentorarc') { c -> docker.image('mysql').inside("--link ${c.id}:db") { /* Wait until mysql service is up */ sh 'while ! mysqladmin ping -hdb --silent; do sleep 1; done' } docker.image('maven:3-alpine').inside("--link ${c.id}:db") { 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 pom.xml +4 −0 Original line number Diff line number Diff line Loading @@ -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> Loading Loading
Jenkinsfile +21 −1 Original line number Diff line number Diff line Loading @@ -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' } Loading @@ -44,5 +44,25 @@ pipeline { } } } stage('Quality'){ steps{ script{ withCredentials([usernamePassword(credentialsId: 'SonarCloud_Zegorax_Token', passwordVariable: 'SONARCLOUD_API_TOKEN', usernameVariable: 'SONARCLOUD_API_USER')]) { docker.image('mysql').withRun('-e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=mentorarc -e MYSQL_USER=mentorarc -e MYSQL_PASSWORD=mentorarc') { c -> docker.image('mysql').inside("--link ${c.id}:db") { /* Wait until mysql service is up */ sh 'while ! mysqladmin ping -hdb --silent; do sleep 1; done' } docker.image('maven:3-alpine').inside("--link ${c.id}:db") { 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
pom.xml +4 −0 Original line number Diff line number Diff line Loading @@ -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> Loading