title: Common pipeline with jenkins-shared-libraries
body: <p>I'm keeping the <code>Jenkinsfile</code> on my repositories "lean":</p>
  
  <pre><code>@Library('utils') _
  def svcName = currentBuild.rawBuild.project.parent.displayName
  def sharedLibrary = new pythonApps()
  
  def buildCommands = [ compileData: "python compile.py" ]
  
  
  timestamps {
      commonPipeline(sharedLibrary, svcName, buildCommands)
  }
  </code></pre>
  
  <p>The <code>commonPipeline.groovy</code> is inside the shared library under <code>vars/</code>. Here it is (truncated):</p>
  
  <pre><code>#!/usr/bin/env groovy
  def call(sharedLibrary, svcName, buildCommands) {
      pipeline {
          agent { ... }
          stages {
              stage('Compilation') {
                  steps {
                      script {
                          sharedLibrary.executeStage("compile", buildCommands['compileData'])
                      }
                  }
              }
              ... other stages ...
          }
      }
  }
  </code></pre>
  
  <p>I would like to allow multiple teams with multiple purposes to use the same pipeline, but with a different <code>sharedLibrary</code>.</p>
  
  <p>The issue arises when I need certain jobs to have parameters passed.
  I tried adding the parameters section inside the <code>executeStage</code> of the shared-library, but as per: <a href="https://jenkins.io/doc/book/pipeline/syntax/#parameters" rel="nofollow noreferrer">https://jenkins.io/doc/book/pipeline/syntax/#parameters</a> parameters can be only inside <code>pipeline</code> or <code>stage</code> block, where in <code>executeStage</code> I'm in <code>steps</code> block.</p>
  
  <p>Anyhow to achieve this?</p>