Even after having 'wipe out repository & force clone' option, my workspace is not fresh

865 views
Skip to first unread message

ishan jain

unread,
Apr 20, 2017, 5:45:04 AM4/20/17
to Jenkins Users
I am selecting below option in my build pipeline, where internally i would checkout a repo and work on it. But the worspace with the repository clone is still there in every job execution and this is creating problems for me. I have to manually delete the worspace on the server everytime to make it work and this is so annoying.
Also, i think this cleaning option is not applicable for the workspaces created on slave nodes, but i am not sure. How can i make sure that the workspace is wiped-out everytime with a job, on master and on every slave node it will use.
 















































Mark Waite

unread,
Apr 20, 2017, 8:24:35 AM4/20/17
to Jenkins Users
I'm surprised that doesn't work in a pipeline context.  I thought I had integration tests which were checking that.  I'll need to double check.  Please submit a bug report with steps to duplicate the problem.

Pipeline has the deleteDir() step which will delete the contents of the current directory, or, when wrapped in a dir() step, it will delete the contents of that directory.  Refer to https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#deletedir-recursively-delete-the-current-directory-from-the-workspace for the documentation.  That will give you explicit control to delete the contents of the directory from within the pipeline step, without adding the WipeWorkspace extension to your checkout() step.

In your pipeline, are you using the git() step or the more general purpose checkout() step?  If you're using the git() step, you may need to switch to the checkout() step.

Mark Waite

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b5a50c25-ed64-42b6-a106-c473260cb5cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages