Script
Use the Script bundled plugin to specify an operating system command or the path to a script, for example, a Windows batch file or Linux shell script.
Tip: If you use PulseUno as part of Dimensions CM, store your script files in Dimensions CM. Paths must be relative to the stream root.
Configuration
When you add the Script plugin step to a chain, specify the following configuration details:
Field | Description |
---|---|
Title | Enter a name for this plugin step. |
Language of script |
Select a script language:
|
Location |
Select the script location:
|
Support legacy ${var} variable replacement |
The syntax for referencing variables is {{variable-name}}. By default, PulseUno also recognizes the legacy ${variable-name} syntax. (Optional) Clear this option if you want PulseUno to recognize and substitute only the {{variable-name}} variables. |
Use custom shell |
To use a custom shell, select this option and specify the shell location, for example: {{cygwin-path}}/bin/bash This option overrides the use of the default system shell specified in the Language of Script option. Windows Subsystem for Linux (WSL) version limitations: To use WSL 1, you need Windows 10 version 1803 or later. For WSL 2, you need Windows 10 version 1909 or later. |
Use custom exit codes to indicate unstable or aborted script |
(Optional) Set your own exit codes that indicate if a completed build is unstable or failed. Enter a list of exit codes separated by commas. By default, if the script exits with an exit code of 0, it is a Success. If the script exits with a non-zero exit code, it is a Failure. |
Use custom log level mapping |
(Optional) To refine the logs and include or exclude particular entries, specify a regular expression for the relevant log threshold level: Trace, Debug, Info, Warning, Error. Your custom entries override the default patterns. Typically, the script output log is set to the Info level, which includes general information, warnings, and errors. |
Control options |
(Optional) Expand Control options and define the following settings:
|
Output variables | (Optional) Enter the variables to be passed to other steps down the chain. For details, see Publish output variables. |
Environment variables
To reference environment variables in script steps, use the following syntax:
Windows | %ENVVAR_NAME% |
Linux | $ENVVAR_NAME or ${ENVVAR_NAME} |
You can include the following environment variables in scripts.
Variable | Description |
---|---|
PULSE_CHANGESET_ID | The alphanumeric changeset identifier (stream version) or commit hash. |
PULSE_SUITE_NAME | The space in which the chain runs. |
PULSE_PRODUCT_NAME | The product or Git repository in which the chain runs. |
PULSE_STREAM_VERSION |
Dimensions CM products: The stream version that was delivered. PulseUno displays the value in the following format: PRODUCT:STREAM_NAME;VERSION Git repositories: Has the same value as PULSE_CHANGESET_ID. |
PULSE_STREAM_NAME | The name of the stream or branch associated with the changeset. |
PULSE_CHAINNUM | The build number. |
PULSE_FETCH_STREAM | The name of the stream or branch checked out in the Fetch Sources step. |
PULSE_FETCH_CHANGESET |
The alphanumeric identifier of the changeset checked out in the Fetch Sources step. Has the same value as PULSE_CHANGESET_ID. |
PULSE_STREAMTITLE | The name of the project or stream. |
PULSE_STREAMVERSIONID | An identifier for the stream version in Dimensions CM. |
PULSE_SCMCONNECTIONURI | A unique identifier for the Git or Dimensions CM database. |
PULSE_LOGINNAME | The user who made the delivery. |
PULSE_MESSAGE | The commit message for the delivery. |
PULSE_DIRECTORY | The location of the workspace containing the source code (also set as the working directory of the script). |
PULSE_VAULT_USERNAME PULSE_VAULT_PASSWORD |
Temporary system credentials that represent a one-time username and password to use for deploying artifacts to a vault. Temporary system credentials are valid only for the duration of the chain run. PulseUno generates the username and password values automatically when a chain is triggered, and invalidates them as soon as the chain finishes. |
Note: Legacy environment variables that don't start with PULSE_, for example, CURRENT_DIR, are deprecated.
Variables specified in the environment.properties file are also available to the script as environment variables.
See also: