Search code examples
jenkinsenvironment-variablesworkspace

Jenkins EnvInject Plugin does not resolve $WORKSPACE


I want to inject a new path variable to a folder which resides in my project workspace.

PATH=$PATH:$WORKSPACE/workspace-configuration/bin/sencha_cmd

That's how I defined it in Properties Content

[EnvInject] - Executing scripts and injecting environment variables after the SCM step. [EnvInject] - Injecting as environment variables the properties content PATH=/home/tomcat/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/java/latest/bin:$WORKSPACE/workspace-configuration/bin/sencha_cmd

As you can see the $WORKSPACE variable was not resolved

What am I doing wrong?


Solution

  • Prepare an environment for the run needs to be checked in General settings of the Jenkins Job