title: How to receive quality gate status from SonarQube in Jenkins pipeline?
body: <p>For the below pipeline script:</p>
  
  <pre><code>   stage('stage1'){
  
      withSonarQubeEnv(server){
              sh "${scannerHome}/bin/sonar-scanner"
          }
     }
  </code></pre>
  
  <hr>
  
  <p><code>stage1</code> launches Sonar scan and exit with success state.</p>
  
  <p><code>stage2</code> waits for 30 minutes until sonar scan completes, jenkins is suppose to receive QualityGate status, as per below code.</p>
  
  <pre><code>   stage('stage2'){
  
          timeout(time: 40, unit: 'MINUTES') {
              def qGate = waitForQualityGate()
              if (qGate.status != 'OK') {
                  error "Pipeline aborted due to quality gate failure: ${qGate.status}"
              }
          }
      }        
  </code></pre>
  
  <hr>
  
  <p>We have Sonar server and sonar scanner configured in Jenkins.</p>
  
  <p>Is there additional configuration required to receive quality gate status?</p>