How do I delete a file in Jenkins?

How do I delete a file in Jenkins?

2 Answers

  1. In the job configuration, in the build step, select the option “execute unix command”
  2. In the box for the shell script, you can use rm -rf <>

How do you delete a file in Shell?

To delete a specific file, you can use the command rm followed by the name of the file you want to delete (e.g. rm filename ). For example, you can delete the addresses. txt file under the home directory.

How do you delete a file in bash?

How to Remove Files

  1. To delete a single file, use the rm or unlink command followed by the file name: unlink filename rm filename.
  2. To delete multiple files at once, use the rm command followed by the file names separated by space.
  3. Use the rm with the -i option to confirm each file before deleting it: rm -i filename(s)

How do I delete a folder in Jenkins?

Delete views and folders – Jenkins Tutorial To delete a view you would start by entering the view, and I’ve selected Build for this example, and on the left hand menu selecting Delete View. I get a safety warning asking if I really want to delete this item. I’ll click Yes and indeed the view goes away.

How do I delete a file in Jenkins workspace?

To clean up the workspace before build: Under Build Environment, check the box that says Delete workspace before build starts. To clean up the workspace after the build: Under the heading Post-build Actions select Delete workspace when build is done from the Add Post-build Actions drop down menu.

How do I delete a folder and it’s all contents?

To remove a directory and all its contents, including any subdirectories and files, use the rm command with the recursive option, -r . Directories that are removed with the rmdir command cannot be recovered, nor can directories and their contents removed with the rm -r command.

How do I clear Jenkins disk space?

Procedures Projects can take to clean up disk space

  1. Use a ./tmp dir in your jobs workspace.
  2. Configure your jobs to wipe workspaces on start or finish.
  3. Configure your jobs to only keep 5 or 10 previous builds.
  4. Configure your jobs to only keep 5 or 10 previous artifacts.