leonelhl

Example Pipeline Jenkins

Jul 11th, 2018 (edited)
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 0.86 KB | None | 0 0
  1. node {
  2.    def mvnHome
  3.    stage('Preparation') {
  4.       git branch: 'master', url: 'https://[email protected]/acl-leonelhl/maven-multiple.git'
  5.       mvnHome = tool 'Maven'
  6.    }
  7.    stage('Build') {
  8.       sh "'${mvnHome}/bin/mvn' -f proyecto-clave/pom.xml clean install"
  9.    }
  10.    stage("SonarQube analysis") {
  11.        withSonarQubeEnv('SonarQube') {
  12.       sh "'${mvnHome}/bin/mvn' -f proyecto-clave/pom.xml sonar:sonar"
  13.    }  
  14.    }
  15.    
  16.    stage("Quality Gate") {
  17.                 timeout(time: 1, unit: 'HOURS') {
  18.                     // Parameter indicates whether to set pipeline to UNSTABLE if Quality Gate fails
  19.                     // true = set pipeline to UNSTABLE, false = don't
  20.                     // Requires SonarQube Scanner for Jenkins 2.7+
  21.                     waitForQualityGate abortPipeline: true
  22.                 }
  23.            
  24.         }
  25. }
Add Comment
Please, Sign In to add comment