REM create a file to hold environment variables for all subsequent
labelled build jobs
del C:\hudson\jobs\shareableCustomWorkspace\labelledJobsEnvVars.txt
echo APPLICATION_BINARY_VERSION=%APPLICATION_BINARY_VERSION% > C:
\hudson\jobs\shareableCustomWorkspace\labelledJobsEnvVars.txt
echo BUILD_STRING=%BUILD_STRING% >> C:\hudson\jobs
\shareableCustomWorkspace\labelledJobsEnvVars.txt
echo SVN_TAG_DATE=%SVN_TAG_DATE% >> C:\hudson\jobs
\shareableCustomWorkspace\labelledJobsEnvVars.txt
echo SVN_TAG=IQ4 WinCE OS v%BUILD_STRING% %SVN_TAG_DATE% >> C:\hudson
\jobs\shareableCustomWorkspace\labelledJobsEnvVars.txt
Then in any subsequent jobs ...
Tick "Inject environment variables to the build process"
Properties File Path
C:\hudson\jobs\shareableCustomWorkspace\labelledJobsEnvVars.txt
then just use the variables as normal.
That's it!
On Apr 6, 12:12 am, shanz <[email protected]> wrote:
> You could create another file with the version number in the java
> property (key=value) format.
> Then you can use the EnvInject plugin to inject the environment
> variable (MY_NEW_VAR) into your job/build.
> The advantage of this approach is that the variable can be visible
> throughout the whole job/build.
> You just enter the path/myVersion.txt in the Properties File field of
> the plugin.
>
> Alternatively just use DOS, eg: To place the first line of a file into
> a variable, do this
> Set /P MyVar=<aFilename>
> The downside to this later approach is that you may have to repeat it
> if you open several shells.