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?