Thank you all!! :) Is it valid to use the below to get the AbstractProject or Project or WorkFlowJob?
SubTask currentExecutable = run.getExecutor().getCurrentExecutable().getParent(); Thanks! On Friday, 28 August 2015 13:36:05 UTC+5:30, Daniel Beck wrote: > > > On 28.08.2015, at 06:20, Vinodhini Vijay <[email protected] > <javascript:>> wrote: > > > I had overridden the method : > > > > public void setUp(Context context, Run<?, ?> run, FilePath workspace, > Launcher launcher, TaskListener listener, EnvVars initialEnvironment) > > throws IOException, InterruptedException > > > > But, how to get the workspace directory location from the Run object? > (As I have to read some file within workspace) > > The point of SimpleBuildWrapper and similar other interfaces is that it > tells you e.g. the relevant workspace as a parameter. This way your > Workflow job/run can have any number of workspaces in parallel. > > --- > > On 28.08.2015, at 08:37, Mads Nielsen <[email protected] <javascript:>> > wrote: > > > You can get the Workspace from the run object by doing > run.getExecutor().getCurrentWorkspace(). > > From Javadoc of Executor#getCurrentWorkspace(): > > > If current executable is AbstractBuild, return the workspace that this > executor is using, or null if the build hasn't gotten to that point yet. > > So that won't work for Workflow, which isn't based on AbstractBuild. > > -- 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/da8ae8fa-daf8-4470-9fad-413cfae77f57%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
