Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins job fails to remove directory

Tags:

jenkins

I am running make script(Execute Shell command option) inside a jenkins job.
The make script has rm -rf <directory name> shell command.
This command fails with error saying the Directory is not empty. Since script uses rm -rf it should work even if directory is not empty.
Not sure what is wrong here.
Any help around this will be much appreciated.

like image 339
Sandy Avatar asked Apr 05 '17 18:04

Sandy


People also ask

How do I delete a Jenkins job folder?

Delete the job provisioner from Jenkins. Navigate to Admin Console->Jenkins->jobs->job-provisions folder, select the necessary provisioner and click the drop-down right to the provisioner name. Select Delete project.

Is project deletion possible in Jenkins?

To delete any job from Gui,Go to your job and on left side,click on delete project. Save this answer.

What is Jenkins working directory?

The Jenkins home directory contains all the details of your Jenkins server configuration, details that you configure in the Manage Jenkins screen. These configuration details are stored in the form of a set of XML files. Much of the core configuration, for example, is stored in the config. xml file.


1 Answers

If your Jenkins job is executed on a Linux machine, this could b:

  • a permission issue.
  • a race condition issue (which is why deleting files first is a good idea. Then your rm -Rf will delete all the empty folders)

On Windows, check the full error message: there could be a resource preempted by the OS (used by another process).

like image 192
VonC Avatar answered Nov 15 '22 07:11

VonC