Static workspace

Create a workspace using a predefined workspace. When creating a static workspace, ensure the following is in place:

  • The existing workspace used to create the static workspace must have a valid view.

  • The plugin user creating the workspace must own the workspace being used a template.

  • The spec used to create the workspace must be unlocked allowing the plugin user to make edits.

Jenkins will automatically set the workspace root and may override the CLOBBER option.

The following options are available when configuring a static workspace.

  1. In Workspace behaviour, ensure that Static view (static view, controller only) is selected.
  2. Use Character Set to set the character set used by Jenkins when syncing files from the PerforceP4 Server. This should be set to none unless the workspace is connected to a Unicode enabled P4 Server.
  3. In Workspace name, enter a unique name for the manual workspace. Each Jenkins agent node must use a distinct Perforce workspace. The name is generated using a format string that substitutes predefined variables. You must include at least one variable, but it's recommended to use the following as a minimum:

    jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}

    For more information about variables, see Variable Expansion

    Pipeline:

    • Use a unique workspace name for the Jenkinsfile that will not get reused by the sync steps in the script. A postfix of -script will help to identify the workspace's use and make it unique from code sync steps.
    • Variables in the script for the workspace name must be surrounded by single quotes as shown:

    • name: 'jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}',

      Using full double quotes " expands the variables early and the script will fail.

Static Workspace Configuration