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

Interpret Nested Variables Throughout Jenkins

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Component/s: core
    • Labels:
      None
    • Similar Issues:

      Description

      This is very similar to the following issue, but is a request for a global solution across Jenkins:
      https://issues.jenkins-ci.org/browse/JENKINS-12287

      Essentially, I am starting to need to duplicate all of my jobs for different environment stacks. Some of these jobs form a long build pipeline. Thee same steps will be executed, but against different subversion branches and/or data sources.

      I want to be able to create that build pipeline once, but to be able to specify parameters when running it. The best way to do this (AFAIK) for "Run Script" build steps is to do an eval command to interpret nested variables.

      So if I define the following in my global config:

      $RELEASE_BRANCH_03=http://server:port/repository/branches/03_BRANCH

      And I then create a build parameter for a job (or set of jobs):

      $STACK= (default value: 03)

      I can use the following notation (or something similar) in Maven builders, Script builders and even subversion urls contained within the jobs in my pipeline:

      ${RELEASE_BRANCH_${STACK}}

      And it will be interpreted as $RELEASE_BRANCH_03 or http://server:port/repository/branches/03_BRANCH.

        Attachments

          Issue Links

            Activity

            Hide
            danielbeck Daniel Beck added a comment -

            Nobody seems to care about this feature. Also, use case is not compelling:

            It's possible to define

            RELEASE_BRANCH=http://..../${BRANCH}_BRANCH

            and this will evaluate correctly wherever $BRANCH is defined.

            Show
            danielbeck Daniel Beck added a comment - Nobody seems to care about this feature. Also, use case is not compelling: It's possible to define RELEASE_BRANCH=http: //..../${BRANCH}_BRANCH and this will evaluate correctly wherever $BRANCH is defined.

              People

              Assignee:
              wolfs Stefan Wolf
              Reporter:
              leojhartiv leojhartiv
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: