-
Improvement
-
Resolution: Fixed
-
Minor
-
None
I have a properties file called version.properties in the root dir of the project, and I'm trying to read an env var from it and apply it in the build.
In the current situation when I check "Prepare an environment for the run" then put "version.properties" in the "Properties File Path" it gives me the following error:
[EnvInject] - Loading node environment variables. [EnvInject] - Preparing an environment for the build. [EnvInject] - Keeping Jenkins system variables. [EnvInject] - Keeping Jenkins build variables. [EnvInject] - [ERROR] - The given properties file path 'version.properties' doesn't exist. [EnvInject] - [ERROR] - Missing file path was resolved from pattern 'version.properties' .
So, in order to get the build not to fail is by specifying the full workspace path; so something like /var/lib/jenkins/<JOB_NAME>/version.properties
Instead of typing the full workspace path, I was trying to do the following "$WORKSPACE/version.properties" but unfortunately that results in the same as above because it literally looks for "$WORKSPACE/version.properties" instead of translating what $WORKSPACE is.
Error looks like this:
[EnvInject] - [ERROR] - The given properties file path '$WORKSPACE/version.properties' doesn't exist. [EnvInject] - [ERROR] - Missing file path was resolved from pattern '$WORKSPACE/version.properties' .
- duplicates
-
JENKINS-13096 should be able to use Jenkins Environment Variables (JENKINS_HOME, WORKSPACE) in the properties file path
- Resolved