Dependencies

This plugin integrates Plastic SCM to Jenkins. This way, users can automatise builds in Plastic SCM using Jenkins.

Configuration

System configuration

In order to configure the plugin, you need a "cm" executable installed in the Jenkins server machine. Then, please follow these steps:

Open the system configuration page "Manage Jenkins" and navigate to "Configure System".

Then, search the "Plastic SCM" section and enter the path to the "cm" (the command line client).

Job configuration

With Plastic SCM selected in the Source Code Management section of your job, enter the required selector (see picture below). In this textbox you can configure the repository to use and the branch that should be loaded in the workspaces managed by Jenkins. Optionally, select whether the workspace should be cleared between builds; or change the generated workspace name; or add multiple Plastic SCM workspaces to the Jenkins workspace.

The plugin will automatically create the needed workspaces pointing to the specified branch.

You can setup not only branches (which is the normal case), but labels as well as changesets in the selector.

You can also use build parameters in the selector. Example: Imagine that you define two build parameters in a project:

branchname - default value (/main)

repositoryname - default value (default)

Then you can use those parameters in the Plastic SCM selector using %parameter_name%. In this case you could write the following selector:

repository '%repositoryname%'
path "/"
smartbranch '%branchname%'

Requirements

The plugin requires that Plastic SCM "cm" command line tool is installed on the master and slave machines.

Plugin version information

This plugin has been developed by Codice Software S.L., owner of the Plastic SCM product.

Change log

Version 2.20

We improved how the plugin reports errors in a Pipeline with Lightweight checkout. Before this, if the Jenkinsfile download failed only a 'NULL' message was printed. Now the complete command execution is displayed.

Fixed an incompatibility with other plugins if they require the SCM plugin to support the ChangeLogSet.Entry.getAffectedfiles() method.

Version 2.19

Added support to SCM environment variables for pipelines.

Now, you can check the available ones here: https://<your-jenkins>/env-vars.html

Version 2.18

The "${workspace-path} is not in a workspace" error was thrown the next time that Jenkins started a build if the workspace had been previously removed. Fixed.

The find changeset operation used a wrong branch when the specified branch value was different from the default one in parameterized builds. Fixed

Version 2.17

The checkout process will undo all local changes in the workspace if there are any, to make sure the update operation won't fail.

The environment variables weren't properly set if the current or previous build checkout failed. Fixed.

The Plastic SCM plugin didn't work with pipeline projects. This is a regression of 2.16 version. Fixed.

Version 2.16

The Plastic SCM plugin had a file path issue that prevented it from working as expected when the master and slave instances had different OS. Fixed.

Version 2.15

The parameters of the plastic workspace name were not correctly resolved. It means, it used the exact workspace name string (e.g. 'Jenkins-${JOB_NAME}-${NODE_NAME}') without resolving the parameters JOB_NAME and NODE_NAME (e.g. 'Jenkins-project-MASTER'). Fixed.

Version 2.14

The Plastic SCM plugin can work with multiple plastic workspaces or just a single plastic workspace. Now, the jenkins workspace and the plastic workspace paths will match in the single workspace mode.

Therefore, some jenkins features (such as pipeline shared libraries) that need both paths to match will correctly work.

Version 2.13

Added support for the lightweight checkout feature in the pipeline jobs. It requires that the latest version of 'cm' is installed.

The environment variables were not published when there were no new changes in the build. Fixed.

Version 2.12

In Blue Ocean, if a build included multiple changesets, only the first one was rendered in the details. Also, the info for the commit and timestamp columns were not filled. Fixed.

Version 2.11

Reduced the number of duplicated builds that can happen using the Plastic SCM plugin. Now, the scm polling takes into account the current build, avoiding to start a new build for the same changeset.

Version 2.10

We fixed an issue configuring existing pipeline projects: the PlasticSCM entry didn't appear in the SCM dropdown list if the pipeline was set to get the script from SCM.

Also, now the Plastic SCM configuration will automatically propose a default workspace name for the first (mandatory) workspace.

Version 2.9

From now on, each build will publish environment variables containing the data of the built changeset for each configured workspace. These are the variables exposed by the main workspace of the project:

PLASTICSCM_CHANGESET_ID: Number of the currently built changeset

PLASTICSCM_CHANGESET_GUID: GUID of the currently built changeset

PLASTICSCM_BRANCH: Name of the branch in Plastic SCM

PLASTICSCM_AUTHOR: Name of the user who created the currently build changeset

PLASTICSCM_REPSPEC: The configured repository specification for the current build

Additional workspaces will include their position in the list, like this:

PLASTICSCM_1_CHANGESET_GUID

PLASTICSCM_5_AUTHOR

PLASTICSCM_9_CHANGESET_ID

etc.

Version 2.8

The required core version is now 1.580.1

Added support for pipelines

Fixed builds being triggered if connection with the Plastic SCM server was lost.

Plastic SCM commands will be retried 3 times from now on, waiting 0.5 seconds between retries.

Version 2.7

Fixed a problem causing parameterized builds to have their workspaces deleted before each build run.

Version 2.6

Replaced all relative paths (implicit or explicit) with full, explicit paths. This fixed several issues on Mac OS X since apparently the current working directory for VCS commands is being set to '/' by Jenkins.

Version 2.5

Version 2.4

Workspaces were being deleted before each build on Windows, regardless of the actual value of the "Use update" checkbox. Fixed.

Version 2.3

Added build parameters support in the Plastic SCM selector. Jenkins allows to define build parameters (https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build), and Plastic SCM now can use those parameters in its selector. IMPORTANT NOTE: When using parametrized builds, maybe the Poll SCM feature may not work as expected because Jenkins performs the poll with the LAST USED workspace. So maybe the selector is not placed in the branch you expect the poll is performed. When using parametrized builds we recommend setting up two Jenkins projects:

One for the parametrized build

Other, with an static selector to perform the poll.

Fixed: When a changeset was a result of a merge, Jenkins was not able to properly present modified elements in 'Changes' chapter.

Version 2.2

The Jenkins workspaces now support multiple Plastic SCM workspaces.

Version 2.1

Fixed an issue related to the non-ASCII characters included on the date on some cultures such as Korean culture.

Support labels and changesets in the Plastic SCM selector.

The plugin did not reuse Plastic SCM workspaces correctly when the 'Use update' preference was set. Fixed.