-
Improvement
-
Resolution: Unresolved
-
Major
-
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.
danielbeck, my use-case is almost similar to Andrey's one.
We use an automatic reporting flows, which add job names to test classpathes. Since the parsing of BUILD_ID and JOB_NAME is a 'worst practice' in any case (formats may change at some point), the variable could be useful.
The main challenge is to select a proper variable name, because JOB_NAME has been already occupied.
IMO, MATRIX_PROJECT_NAME is a best option