Clean workspace in Jenkins2

126 views Asked by At

I have an issue in Jenkins2 that a build is failing and only clean to workspace fix the problem. In Jenkins1 I was able to clean the workspace manually, in Jenkins2 I don't see this issue.

I'm deleting the remote branches and recraete them to clean the workspace but I can't do that for master.

How can I clean the workspace without delete the remote branch?

1

There are 1 answers

0
Ido Ran On BEST ANSWER

I've found that the problem was a broken symlink in node_modules directory so I've used to following task to clean it:

task cleanBrokenSymlinksInNodeModules << {
    file("node_modules").eachFileRecurse {
        if (! it.exists()) { it.delete() }
    }
}

I've copy this solution from GRADLE-1843