Plugin procedures can be used in procedure steps, process steps, and pipeline tasks, allowing you to orchestrate third-party tools at the appropriate time in your component, application process, or pipeline.
Depending on your plugin configuration and how you run procedures, the Differences in plugin UI behavior. field may behave differently in the CloudBees CD/RO UI. For more information, refer to |
AddTextToFile
Add text to a file
Input parameters
Parameter | Description |
---|---|
Path |
Required. Path to the file to write to. |
Append mode |
Required. If selected, the new text is appended to the file rather than replacing it. |
Add new line to the end |
Required. If checked, text is added as a new line at the end of the file. |
Content |
Required. Content to write in the file. |
ChangeOwnershipOrPermissions
Changes the ownership and/or permissions of files and folders.
This procedure is not supported for Windows OS. |
Input parameters
Parameter | Description |
---|---|
Path |
Required. Path to the file/directory. |
Owner |
Name of a valid user. |
Mode |
New mode to apply, such as |
Recursive |
If checked, applies mode/owner recursively to directories. |
Verbose mode |
Required. If checked, displays additional information about the process. |
CheckFilePermissions
Checks if a specific user has permissions on a file.
This procedure is not implemented for Windows OS. |
Input parameters
Parameter | Description |
---|---|
Username |
Required. Name of the user to validate. |
Path |
Required. Path to the file to validate. |
Read |
Required. If selected, validates that the user has read permissions for the file. |
Write |
If selected, validates that the user has write permissions for the file. |
Execute |
If selected, validates that the user has execute permissions for the file. |
Copy
Copy a source file/directory to a destination location.
Input parameters
Parameter | Description |
---|---|
Source |
Required. Directory or file to copy. Path may end in a glob pattern to copy a subset of files to the destination. For more information, refer to Copying as the destination path versus into the destination path. |
Destination |
Required. Path to copy source file/directory to. |
Replace destination if it exists |
If selected and the destination is a pre-existing directory, the file/directory is recursively cleared prior to copying sources into it. If not set and the destination is a pre-existing file, the step returns an error. |
Create Zip File
Creates a .zip file from a directory or file.
Input parameters
Parameter | Description |
---|---|
Source path |
Required. Directory or file to copy. Path may end in a glob pattern to copy a subset of files to the destination. For more information, refer to Copying as the destination path versus into the destination path. |
Zip file |
Required. Name for newly created .zip file. This must be a new name; existing .zip files cannot be overwritten. |
DiffFolders
Performs a diff of two directories.
Input parameters
Parameter | Description |
---|---|
First directory |
Required. Path to the first folder to diff. |
Second directory |
Required. Path to the second folder to diff. |
Suppress identical file messages |
Required. If selected, messages about identical files are suppressed. |
DirectoryExists
Verify if a directory exists.
Input parameters
Parameter | Description |
---|---|
Path |
Required. Directory path to verify. |
Procedure results handling strategy |
The strategy of procedure results handling. If set to Default, the procedure fails if the directory does not exist. If set to Property, the procedure does not fail, and the appropriate output parameters/properties are set. |
Output propertySheet path |
Creates a |
FileExists
Verify if a file exists or not.
Input parameters
Parameter | Description |
---|---|
Path |
Required. Path of the file to check. |
Procedure results handling strategy |
The strategy of procedure results handling. If set to Default, the procedure fails if the directory does not exist. If set to Property, the procedure does not fail, and the appropriate output parameters/properties are set. |
Output propertySheet path |
Creates a |
Move
Move a source file/directory.
Input parameters
Parameter | Description |
---|---|
Source |
Required. Path to the file/directory to move. Path may end in a glob pattern to move a subset of files to the destination. |
Destination |
Required. Path to move source file/directory to. |
Replace destination if it exists |
If set, and if the destination is a pre-existing directory, the destination is recursively cleared prior to moving sources into it. If not set, and if the destination is a pre-existing file, the step returns an error. |
Remote Copy - Native
Copy a file/directory from one CloudBees CD/RO resource to another, using the CloudBees CD/RO built-in getfiles/putfiles mechanism.
Ensure the Stomp port, by default 61613 , is opened on the CloudBees CD/RO server. This port must be opened bi-directionally to transfer files to and from the server. For more details, refer to Configuring Stomp for Preflight and EC-FileOps file transfers.
|
Input parameters
Parameter | Description |
---|---|
Source resource |
Required. Resource to copy file/directory from. |
Source workspace |
Workspace on the source resource containing the file/directory to transfer. If the file/directory is outside of a workspace, this workspace is used to store temporary files, and it is recommended this workspace refer to a local disk directory on the resource. |
Source path |
Required. Directory or file to copy. Path may end in a glob pattern to copy a subset of files to the destination. For more information, refer to Copying as the destination path versus into the destination path. |
Destination resource |
Required. Resource to copy the file/directory to. |
Destination workspace |
Workspace on the destination resource to copy the file/directory. If the destination location is outside of a workspace, this workspace is used to store temporary files, and it is recommended this workspace refer to a local disk directory on the resource. |
Destination path |
Required. Location on destination resource to copy file/directory to. |
Remote Copy - SCP
This procedure copies a file or directory between a CloudBees CD/RO resource and some other machine (possibly a different CloudBees CD/RO agent) using the SCP protocol. Unlike other copy steps, this remote copy step does not generally create intermediate directories in the destination path if needed.
If the destination is a pre-existing file, it will be overwritten. If the destination is a pre-existing directory, pre-existing files/directories in it will be overwritten if there are corresponding elements in the source. |
For plugin v3.1.0 and earlier, when configuring the plugin with a CloudBees CD/RO project credentials, if you attempt to use the button, the process will freeze.For plugin v3.1.0 and earlier, you must manually enter your CloudBees CD/RO project credential path in the Credential field. Use the format:
|
CloudBees CD/RO resource ⇒ Non-CloudBees CD/RO host
In this configuration, the SCP operation is driven by a step on a CloudBees CD/RO resource that establishes an SSH connection with an arbitrary host and uploads files or directories to that host.
Parameter | Description | ||
---|---|---|---|
Source resource |
Required. Name of the resource to copy file(s) from. |
||
Source workspace |
Required. Name of workspace on source resource from which file(s) are to be copied. |
||
Source path |
Required. Path of source file/directory to copy. If relative, this path is evaluated relative to the source workspace. Relative or absolute path for the files or directories to upload. A relative path is processed relative to the Source Workspace. This path may end in a glob pattern to copy multiple files from a source directory to the destination. For more information, refer to Copying as the destination path versus into the destination path. |
||
Destination host |
Required. Name/IP of the destination host to copy the file(s) to. |
||
Credential |
Required. Property path to credential for authenticating with the SSH server running on the source machine.
|
||
Destination path |
Required. Destination path to copy the file/directory. If relative, this path is evaluated relative to the destination workspace. |
||
Debug level |
Debug logging level to use for this step. |
Non-CloudBees CD/RO host ⇒ CloudBees CD/RO resource
In this configuration, SCP operation is driven by a step on a CloudBees CD/RO resource that establishes an SSH connection with an arbitrary host and downloads files or directories from that host.
Parameter | Description | ||
---|---|---|---|
Source host |
Required. Name/IP of the host to copy the file(s) from. |
||
Source path |
Required. Path of source file/directory to copy. If relative, this path is evaluated relative to the source workspace. For more information, refer to Copying as the destination path versus into the destination path. |
||
Destination resource |
Required. Name of the resource to copy the file(s) to. |
||
Destination workspace |
Required. Name of the workspace on the destination resource to copy the file(s) to. |
||
Credential |
Required. Property path to credential for authenticating with the SSH server running on the source machine.
|
||
Destination path |
Required. Destination path to copy the file/directory. If relative, this path is evaluated relative to the destination workspace. |
||
Debug level |
Debug logging level to use for this step. |
CloudBees CD/RO resource ⇒ CloudBees CD/RO resource
In this configuration, the SCP operation is driven by a step on a CloudBees CD/RO resource that establishes an SSH connection with another CloudBees CD/RO resource and either downloads or uploads files or directories from or to that resource. This configuration is particularly useful for copying files between different workspaces through the resources that can access those workspaces.
Parameter | Description |
---|---|
End-point that has an SSH server |
Required. Select the endpoint with the SSH server for the SCP operation. |
SSH server machine is a Windows host |
Required if using a Windows host. Check if SSH server end-point is a Windows host. The resource that contains the source files or directories. |
Source resource: |
Required. Name of the resource to copy file(s) from. |
Source workspace: |
Required. Name of workspace on source resource from which file(s) are to be copied. |
Source path: |
Required. Path of source file/directory to copy. If relative, this path is evaluated relative to the source workspace. For more information, refer to Copying as the destination path versus into the destination path. |
Destination resource: |
Required. Name of the resource to copy the file(s) to. |
Destination workspace: |
Required. Name of the workspace on the destination resource to copy the file(s) to. |
Destination path: |
Required. Destination path to copy the file/directory. If relative, this path is evaluated relative to the destination workspace. |
Debug level: |
Debug logging level to use for this step. |
SyncFolders
Perform a folder diff of two folders and syncs their content.
Input parameters
Parameter | Description | ||
---|---|---|---|
First directory |
Required. First folder to sync. |
||
Second directory |
Required. Second folder to sync. |
||
Sync rule |
Required. Rule to apply when synchronising folders:
|
||
Dry run |
If selected, the copy/delete operations are treated as a dry run and only print the results. |
||
Verbose mode |
If checked, additional information is printed about the sync process. |
UpdateLastTouch
Update the last accessed and modified date of a file.
Input parameters
Parameter | Description |
---|---|
Path |
Required. Path to the file to |
Year |
Required. The year to set for the file. |
Month |
Required. The month to set for the file. |
Day |
Required. The day to set for the file. |
Hour |
The hour to set for the file. |
Minute |
The minute to set for the file. |
Second |
The second to set for the file. |
TimeZone |
Required. A valid timezone for the date. For example, |
Copying as the destination path versus into the destination path
As stated in the plugin procedures, source paths may end in glob patterns if you are copying multiple files from a source directory to the destination. Depending on whether the destination exists, the source may be copied as the destination or into the destination.
Refer to the following table for examples illustrating step behavior in various circumstances. This example assumes resource-to-resource for simplicity, although it also applies to configurations using absolute paths instead of relative paths.
Source Path | Destination Path | Behavior |
---|---|---|
/var/tmp/simple.txt |
simpleNew.txt |
|
/var/tmp/simple.txt |
preexistFile.txt |
|
/var/tmp |
preexistDir |
|
/var/tmp |
newDir |
|
/var/tmp/* |
newDir2 |
|
/var/tmp/s* |
newDir2 |
|