diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..8e91a61b --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,30 @@ +pipeline { + agent any + stages{ + stage("sonarqube static code check"){ + agent{ + docker{ + image 'openjdk:11' + args '-v $HOME/.m2:/root/.m2' + } + } + + steps{ + script{ + withSonarQubeEnv(credentialsId: 'sonar-password') { + sh 'chmod +x gradlew' + sh './gradlew sonarqube' + } + timeout(5) { + def qg = waitForQualityGate() + if (qg.status != 'OK'){ + error "pipeline aborted due to quality gate failure: ${qg.status}" + } + } + } + } + + } + } + +} \ No newline at end of file