title: Groovy code in script block to replace general build step step()
body: <p>Among the possible steps one can use in a Jenkins pipeline, there is one with the name <strong>step</strong>, subtitled <em>General Build Step</em>. <a href="https://www.jenkins.io/doc/pipeline/steps/workflow-basic-steps/#step-general-build-step" rel="nofollow noreferrer">https://www.jenkins.io/doc/pipeline/steps/workflow-basic-steps/#step-general-build-step</a> . I need to iterate on calling this step based on the contents of a file. I have created a groovy script to read the file and perform the iteration, but I am not sure how to create the equivalent of my step() in the groovy script. Here is the general format of the step I am trying to perform:</p>
  <pre><code>stage ('title') {
    steps {
      step([
         $class: 'UCDeployPublisher',
         siteName: 'literal string',
         deploy: [
            $class: 'com.urbancode.jenkins.plugins.ucdeploy.DeployHelper$DeployBlock',
            param1: 'another literal string',
            param2: 'yet another string'
         ]
      ])
    }
  }
  </code></pre>
  <p>The script step I have developed looks like this:</p>
  <pre><code>steps {
    script {
       def content = readFile(file:'data.csv', encoding:'UTF-8');
       def lines = content.split('\n');
       for (line in lines) {
          // want to insert equivalent groovy code for the basic build step here
       }
    }
  }
  </code></pre>
  <p>I'm expecting there is probably a trivial answer here. I'm just out of my element in the groovy/java world and I am not sure how to proceed. I have done extensive research, looked at source code for Jenkins, looked at plugins, etc. I am stuck!</p>