I haven't looked into the EnvInject plugin very deeply but from what I can see you have to create an additional "EnvInject build step" after your own build step in order to inject any potential environment variables into the next build step.
The problem with this is if you have both build steps and post build steps. If your build step fails for some reason any previous build steps will not be executed and thus also the EnvInject build step that is suppose to inject the environment variables into the build. My plugin works like this: Build step 1: " #!/bin/bash # do some stuff... # result = `some program` echo "RESULT=$result" > $ENVFILE " Build step2: " #!/bin/bash # do some other stuff... echo $RESULT " Post build step: " #!/bin/bash # do something with $RESULT " Regardless if build step 1 exits successfully or not, the post build step will always know about $RESULT. When using the EnvInject, from my understanding, I would have to have another build step in between build step 1 and 2 to get $RESULT into build step 2. And if build step 1 fails, the EnvInject build step will not be executed and thus the post build step will not know about $RESULT. On Tuesday, 26 May 2015 15:38:58 UTC+2, Christopher wrote: > > EnvInject also lets you write to a properties file in one build step > then inject that file for use in all subsequent build steps. > > I see that your plugin may make it a bit more convenient to do so, but > it would be better to merge that functionality into EnvInject, rather > than publishing a separate plugin. > > Regards, > Chris > > > On 26/05/15 15:25, Daniel Olausson wrote: > > No that plugin let's you provide a file containing environment variables > > that are then injected at build execution start. > > > > My plugin provides the user with a file where he/she can store > > environment variables across build steps. > > > > > > > > On Tuesday, 26 May 2015 08:02:10 UTC+2, Dominik Bartholdi wrote: > > > > The I guess its about the same as: > > https://wiki.jenkins-ci.org/display/JENKINS/Envfile+Plugin > > <https://wiki.jenkins-ci.org/display/JENKINS/Envfile+Plugin> > > /Domi > > > > On 25 May 2015, at 21:07, Daniel Olausson <[email protected] > > <javascript:>> wrote: > > > >> Hi, > >> > >> GitHub: > >> https://github.com/rednuht/retainenvironment > >> <https://github.com/rednuht/retainenvironment> > >> > >> Description can be found at: > >> https://github.com/rednuht/retainenvironment/blob/master/README.md > >> <https://github.com/rednuht/retainenvironment/blob/master/README.md> > > >> > >> Shares some similarities with the EnvInject plugin but my plugin > >> doesn't require the user to use any additional build steps. > >> > >> Br, > >> Daniel Olausson > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/1d0a2e6d-2659-4c65-b440-4e6c8da46ff3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
