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

Variable Expansion in Global Variables Not Occurring

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Not sure about standard Pipeline scripts, but in a Declarative Pipeline script, for a given global variable built via:

      Jenkins -> Manage Jenkins -> Configure System

      Name: MYPATH 
      Value: ${WORKSPACE}/../path1/${JOB_BASE_NAME}
      
      ...
      stage ("stage left") {
          steps {
              echo "MYPATH is: " + MYPATH
      ...
      

      The output in the script is:

      [Pipeline] echo
      MYPATH is: ${WORKSPACE}/../path1/${JOB_BASE_NAME}
      

      In Freestyle scripts the WORKSPACE and JOB_BASE_NAME values are expanded at build time. We use these as a nice way to have a few consistent job behaviors across all jobs, but without variable expansion, it seems we have to build and maintain variables in each job script.

        Attachments

          Issue Links

            Activity

            Hide
            bitwiseman Liam Newman added a comment -

            Bulk closing resolved issues.

            Show
            bitwiseman Liam Newman added a comment - Bulk closing resolved issues.

              People

              Assignee:
              abayer Andrew Bayer
              Reporter:
              jedavis Jason Davis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: