title: How do I run a task on failure in Jenkins?
body: <p>I've got a Jenkins job that is intended to do the following:</p>
  
  <ol>
  <li>Build a project and deploy it to a test server</li>
  <li>Run tests</li>
  <li>If the tests fail, roll back the server to the previous version</li>
  <li>If the tests succeed, update the version in our source control system</li>
  </ol>
  
  <p>Because we have a single test server, we need to ensure that Jenkins is only running a single version of this job at a time. Unfortunately, we can't seem to find a way to run a job on failure <em>and</em> keep the upstream job from executing while the downstream job is running.</p>
  
  <p>Is there an easy way to do this? Is there a better way?</p>