Skip to content

Perforce

timrademaker edited this page Mar 26, 2021 · 7 revisions

Note: This currently uses the P4 Plugin for Jenkins.

Initialization

init

Set up the configuration for a Perforce connection.

Parameters

credentials: The ID of the credentials to use.

workspaceNameFormat: The format to use for the (temporary) workspace. When this is the name of an existing workspace, the existing workspace is used instead.

workspaceTemplate (optional): The workspace to use as a template for the Jenkins syncing workspace. If this is a workspace you only use for build servers, you might want to enable "Allwrite" and "Clobber" in the workspace's file options to prevent potential issues.

viewMapping (optional): The view mapping to use for the workspace.

host (optional): The remote server address of Perforce. Only needed when createTicket() is called.

Perforce Operations

pull

Get latest on files that are visible through your workspace's view mapping.

Parameters

revision (optional): The version or label to sync with. Latest by default (represented by an empty string).

deleteGeneratedFiles (optional): When set to true, files that are not in the depot are removed, and missing and modified files are re-added. Defaults to false.

quiet (optional): When true, most Perforce messages are suppressed. Errors and summary details are still displayed. Defaults to true.

forceClean (optional): This option is not recommended because it is very inefficient. Used if you do not trust the content of your workspace. Removes all of the files in the workspace root, including the build history, and then force syncs the required files. Defaults to false.

clean

Cleans the workspace.

unshelve

Unshelve a specific shelve.

Parameters

shelveID: The ID of the shelve to unshelve.

getChangelistDescription

Get the changelist description of a certain changelist.

Parameters

changelistID: The ID of the changelist to get the description for.

createTicket

Create a Perforce ticket. Can be used for Swarm's init function.

Clone this wiki locally