On Tuesday, February 26, 2013 5:40:16 PM UTC+1, Vincent Latombe wrote:
> Hi,
>
> you can attach an Action object to the build in the first buildstep with
> the data that you need to share, then retrieve it in the second buildstep.
>
> Hope this helps,
>
>
> Vincent
>
Ok, that was helpful! It works. I made an InvisibleAction (because the
initial aim for an Action is to be visible on the left menu of the job)
which can contribute to the environment variables by implementing the
EnvironmentContributingAction.
A new file for to define the action:
> class ReportAction extends InvisibleAction implements
> EnvironmentContributingAction {
> private String value;
>
> public ReportAction(String value){
> this.value = value;
> }
>
> /* from EnvironmentContributingAction */
> public void buildEnvVars(AbstractBuild<?,?> build, EnvVars env) {
> env.put("REPORT_PATH", value);
> }
> }
And in my builder:
> @Override
> public boolean perform(AbstractBuild build, Launcher launcher,
> BuildListener listener) {
> build.addAction(new ReportAction(this.path));
> ...
On Tuesday, February 26, 2013 5:54:50 PM UTC+1, Ullrich Hafner wrote:
>
> Or even simpler: can't you just obtain the instance of the first builder
> using the API?
>
> Ulli
>
It doesn't look like the API allows this.
Thank you both!
--
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].
For more options, visit https://groups.google.com/groups/opt_out.