Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-32780

Parameterize Multibranch Pipeline via Jenkinsfile

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Not A Defect
    • Icon: Major Major
    • pipeline
    • None

      I apologize if this feature is already present, but I've googled and read through the documentation and haven't been able to find out how to do this.

      One of the biggest benefits of the Multibranch Pipeline and Jenkinsfile is that jenkins jobs are automatically created. However, the only way I've seen to be able to add a build parameter to the job is by manually configuring it.

      My use case is this:

      Project A ( is a Multibranch Pipeline ) builds, and as part of its pipeline, triggers Project B, also a MultiBranch Pipeline. I'd like Project A to pass some information along to Project B for it to use in its build. Specifically, I'd like Project A to identify itself to Project B so that I don't have to hard code the "Upstream Project Name" in Project B for use in the CopyArtifacts step. This allows for looser coupling of build jobs so that I can insert jobs into my overall pipeline much easier.

      I'm not sure if different types of build parameters are harder to support, but for now, the String build parameter would be sufficient.

      Acceptance Criteria:

      1. DSL to support adding scripted build parameters via Jenkinsfile
      2. Supported build parameters are: String
      3. Jenkins UI should pick up build parameters and allow for manual entry when job triggered manually
      4. TOO: Other build parameter types

      Thanks

            jglick Jesse Glick
            mscharp Michael Scharp
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: