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

Expose new env var containing job name without build axis information appended

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • matrix-project-plugin
    • None

      On https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project, section entitled "Jenkins Set Environment Variables" there is a list of useful env vars which I can pick up in my build scripts.

      When you use a "multi-configuration project" the JOB_NAME, depending on your build axis names, gets resolved to something like:

      JOB_NAME=projectName/COMPILER=CL,CONFIG=Debug,PLATFORM=Win32

      Can you expose a new env var which just contains the project name without all the build axis information?

      In my setup I have "Copy files into the job's workspace before building" enabled and my "Files to copy" field contains:

      jobs/projectName/builds/${BUILD_ID}/changelog.xml

      Obviously I'd like to replace "projectName" with the new env var - this would help me maintain a growing number of projects.

          [JENKINS-9905] Expose new env var containing job name without build axis information appended

          Thomas Fields created issue -
          Daniel Beck made changes -
          Component/s New: matrix-project [ 18765 ]
          Component/s Original: core [ 15593 ]
          Oleg Nenashev made changes -
          Assignee New: Oleg Nenashev [ oleg_nenashev ]
          Oleg Nenashev made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 140091 ] New: JNJira + In-Review [ 185371 ]
          Oleg Nenashev made changes -
          Status Original: In Progress [ 3 ] New: Open [ 1 ]
          Oleg Nenashev made changes -
          Assignee Original: Oleg Nenashev [ oleg_nenashev ]

            Unassigned Unassigned
            tfields Thomas Fields
            Votes:
            6 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: