title: How to have SonarQube block code on failure of ci build?
body: <p>We are standing up a CI pipeline using Jenkins and we are using SonarQube to run static analysis.  We have set up quality gates and now we are failing builds, when the gates are not met.  When we fail a build the code is still put into sonarQube. So if a developer tries to promote twice the second build will 'pass'. </p>
  
  <p>Example: 
  Gate is no new critical issues. </p>
  
  <p>The Developer checks in code with 1 new critical issue. 
  The build fails on static analysis (SonarQube has the rule flagged and a blocker). </p>
  
  <p>The Developer checks in code again (no code changes). 
  the static analysis's passes because the critical issue is not 'new'. </p>
  
  <p>Is there a way to revert back to the previous version on a failure, or better yet to run the analysis against the most current non-failing run? </p>
  
  <p>Notes: Version - Sonarqube 5.1.2</p>