In my Jenkins setup I don't have "Inject environment variables" in the 
project configuration, so I'm assuming you are using a specific plugin to 
achieve that.
It would be great to know which one.

>From what I can guess you may using this one: 
https://plugins.jenkins.io/envinject/
If so, then the documentation says that the file you specify as to provide 
the environment variables in the standard "Java property file format" and 
if you are passing the .bat file, then you are passing a file with the 
wrong format.


On Wednesday, 11 March 2020 18:11:03 UTC, Sholom Sanders wrote:
>
> My Jenkins is installed on my Windows build machine. I have a directory on 
> this machine which is dedicated to a Jenkins project. 
> Within this directory I have a  .bat file which sets up environment 
> variables, e.g.
>
> set GIT_UPDATE_DIR=$WORKSPACE
> set MDM_SRC_DIR=$GIT_UPDATE_DIR
> set GIT_BRANCH_FULL=MDM_R$branch
> set WRKSPACE=$JENKINS_HOME\\workspace
> set REL_NUMBER=$branch
>
> The source code is in GIT. I want to inject these variables into the build 
> after the SCM. In the Build Environment of the Project Configure section, I 
> selected "Inject environment variables to the build process" and gave the 
> full path of the file on the build machine. In the Build section, the first 
> thing I do is execute a Windows Batch command  which only has "set". When I 
> do the build, the log shows the script being run with all the variables. 
> However, the "set" command does not show any of the variables being 
> available. What am I doing wrong?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ff2781f0-0870-45a1-b290-e609dadcd4e8%40googlegroups.com.

Reply via email to