Perforce: Cleanup

Used to cleanup the client workspace after the build. Optionally, setting the global option will delete the workspace files.

Tip

To delete the workspace files after the build, use the global setting in Perforce: OnDelete Workspace Options, see Perforce: OnDelete Workspace Options.

Perforce: Cleanup

Delete Client checkbox:

Perforce: OnDelete Workspace Options

Specify how cleanup is handled for a Jenkins job that includes a Perforce: Cleanup post-build action.

From the Jenkins home page browse to Manage Jenkins > Configure System > Perforce: OnDelete Workspace Options:

You can select a number of options:

  • Delete Perforce client: only applicable when deleting a Jenkins job.
  • Delete Workspace files: if your Jenkins job contains a cleanup step or you are deleting a Jenkins job: Perforce deletes the workspace files including the have list.

Jenkins workspace cleanup thread

On rarely used build slaves, the Jenkins workspace cleanup thread can remove your workspaces on those build slaves. This can cause problems for future build jobs that use the workspace on those build slaves.

To avoid this happening, we recommend that you:

  • manage your workspaces though P4 Plugin Perforce: cleanup

  • disable the Jenkins automated workspace cleanup thread by adding the following line to the Jenkins startup arguments:

  • -Dhudson.model.WorkspaceCleanupThread.disabled=true