Jenkinsfile
818 Bytes
#!groovy
node {
stage 'Environment'
if (scm.branches == 'master') {
println 'Nous sommes dans master'
}
// println scm.branches
stage 'Config'
def sonarqubeScannerHome = tool name: 'sonar', type: 'hudson.plugins.sonar.SonarRunnerInstallation'
stage 'Checkout'
checkout([$class: 'GitSCM', branches: [[name: 'origin/$scm.branches']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'grogdevSSH', url: 'git@grogv3.legrog.org:grogv3/web-application.git']]])
stage 'clean install'
withMaven(mavenLocalRepo: '', mavenOpts: '', mavenSettingsFilePath: '') {
sh "mvn clean install"
}
stage 'Scan'
sh "${sonarqubeScannerHome}/bin/sonar-scanner -Dsonar.host.url=http://grogv3.legrog.org:9000"
}