Hello All,

I would like to get the workspace of the Run object. To make workflow 
compatible, my custom build wrapper class extends SimpleBuildWrapper.

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)

I tried to typecast to AbstractBuild, but during build I got 
ClassCastException

java.lang.ClassCastException: org.jenkinsci.plugins.workflow.job.WorkflowRun 
cannot be cast to hudson.model.AbstractBuild

My Workflow code was: 

node{
wrap([$class: 'MyCustomBuildWrapper']) {
   print ('Hello')
}
}


Also, after workflow build is completed, will the workspace gets deleted? 
(As, I couldn't find the workspace folder in my Jenkins home (Also couldn't 
find Workspace Icon/link in Jenkins GUI) after the build completes)

Or will the workspace gets created only after SCM checkout? 

Thanks 

-- 
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/eccdf524-e7a2-4eb2-bba7-839b9a062cc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to