I would like to send an email at the end of my build to inform success or failure. I'm using the email ext-plugin for Jenkins. I want the version number of the build to be the subject of the email.
The problem is that the version is something that changes in each build, so I need to somehow edit an environmental variable to hold the version number each time (I have a script that saves it into a file). This is the default configuration:
I would like to have, for example, set the version number into a variable using windows batch script, like this:
rem # Loading version File number
set MY_BUILD_VERSION=<myVersionFile.txt
rem # Loading content
set MY_BUILD_CONTENT=<myContentFile.txt
And using it in the email plugin, like this:
The problem is that the environmental variables aren't recognized outside the .bat file they are being run from, although I'm using the envInject plugin, the documentation says that what's run from a script won't be recognized outside of it.
Is there any way to load data into the email plugin from a file, or any other dynamic way to load my version number dynamically?