Skip to main content
Version: Release 22.1

Remote Script Tasks Plugin

Remote Script tasks enable Release to execute commands on remote hosts using the Overthere framework, a Java library for manipulating files and executing processes on remote hosts.

You can use Remote Script tasks to:

  • Execute shell scripts on Unix, z/OS, or Microsoft Windows (using Cygwin or WinSSHD) hosts.
  • Execute batch scripts on Microsoft Windows hosts. Note: All scripts will be interpreted as batch files. PowerShell is currently not supported.

The following Remote Script task types are available:

  • Remote Script: Unix: Execute a shell script on a Unix host using SSH
  • Remote Script: Windows: Execute a batch script on a Microsoft Windows host using WinRM
  • Remote Script: Windows (SSH): Execute a shell script on a Microsoft Windows host using SFTP
  • Remote Script: z/OS: Execute a shell script on z/OS

In the release flow editor, Remote Script tasks are marked with a blue border.

Common properties

The following properties are common to all Remote Script task types.

Remote script execution details

PropertyDescription
ScriptThe shell script to execute on the remote host (required)
Remote PathThe path on the remote host where the script should be executed (required)
Temporary Directory PathWhere to store temporary files. This directory will be removed on connection close.

Remote host connection

PropertyDescription
JumpstationThe SSH jumpstation or HTTP proxy to use
Address and PortAddress and SSH port (or Telnet or WinRM port for Windows) of the remote host (required)
Connection typeThe SSH connection type to use:
  • UNIX: SCP, SFTP, SU, SUDO, INTERACTIVE_SUDO, SFTP_CYGWIN, or SFTP_WINSSHD
  • Windows: TELNET, WINRM_INTERNAL, or WINRM_NATIVE
  • Windows (SSH): SFTP_CYGWIN, or SFTP_WINSSHD
  • z/OS: This option is not present, and SFTP will be used (unless overridden in the remoteScript.Zos.connectionType setting in the deployit-defaults.properties file)
Note: To connect to a Windows host, use the WINRM_INTERNAL connection type.

Command output

The following output properties are available:

PropertyDescription
OutputThe variable in which the standard output will be stored
ErrThe variable in which the error output will be stored
important

You must exit your script with Exit 0 to populate task variables. If your script exits with anything other than Exit 0, then the task fails, and the release gets halted. However, if something fails in the script, you can redirect the script with 1>&2 that controls the Err task output. This is an alternative to checking scripts when the task fail and using the XLR failure handling on the task for the appropriate action.

note

The output of the remote script task is in Markdown format. See Using Markdown in Release for more information.

important

You must exit your script with Exit 0 to populate task variables. If your script exits with anything other than Exit 0, then the task fails, and the release gets halted. However, if something fails in the script, you can redirect the script with 1>&2 that controls the Err task output. This is an alternative to checking scripts when the task fails and using the XLR failure handling on the task for the appropriate action.

Unix remote script

The following properties are available in the Remote Script: Unix, Remote Script: Windows (SSH), and Remote Script: z/OS task types.

Credentials

PropertyDescription
UsernameThe Unix host user login ID (required)
PasswordThe Unix host user password
Private keyThe private key to use (verbatim) for authentication
Private key file and PassphraseThe file containing a private key, and an optional passphrase for the key it contains

You can use a password, a private key, or a private key file and passphrase.

Privilege elevation

PropertyDescription
SUDO usernameAccess files and commands after sudo'ing to this user
SU username and SU passwordAccess files and commands after su'ing to this user

Windows remote script

The following properties are available in the Remote Script: Windows task type.

Credentials

PropertyDescription
Username and PasswordThe Windows host user login ID and password
Allow credential delegationIf checked, allow the user's credentials to be used to access. Example: remote shares (only on WINRM_NATIVE connection type).

Connectivity

PropertyDescription
CIFS PortThe port on which the CIFS (SMB) server runs
Windows path to Windows share mappingsMapping from Windows paths to Windows share names. Example: C:\IBM\WebSphereWebSphereShare
TimeoutThe WinRM timeout in XML schema duration format. The default value is PT60.000S
Enable HTTPS for WinRMCheck this if the remote Windows host supports encrypted connections

Using advanced Overthere functionality

Release uses the Overthere framework, which includes several connection options. While most common options are available in the Release GUI, you can use other options as described in the Overthere documentation.

You can change the default values of options that are not exposed in the GUI in the XL_RELEASE_SERVER_HOME/conf/deployit-defaults.properties file.

To use a different setting for a particular option per task, you can create a type modification in the XL_RELEASE_SERVER_HOME/conf/synthetic.xml file for the task types. In the modification, you can add the desired Overthere connection option as a property on the task. These task properties will automatically be used as connection options for Overthere if the name matches.

Example: To make the connection timeout configurable on each task, add this to synthetic.xml:

<type-modification type="remoteScript.WindowsSsh">
<property name="connectionTimeoutMillis" category="input" kind="integer" default="120000"
description="Number of milliseconds Overthere waits for a connection to a remote host to be established"/>
</type-modification>