title: How do I add custom Groovy to steps or conditionalSteps?
body: <p>Using job-dsl I can execute a Shell script with custom bash code and have the process result influence the status (failure, success etc.) of the Jenkins job:</p>
  
  <pre><code> steps {
      shell('./smoketest.sh')
   }
  </code></pre>
  
  <p>What if I want to use custom Groovy to do a smoketest rather than rely on a shell script? I tried writing a simply Groovy function to return 0 or -1 to signal success and failure, but it does not work. How can I execute arbitrary Groovy code in a step?</p>