Plug-in Documentation

Shell

Overview

The Shell plug-in includes steps that run commands on the target system. You can run a command with or without arguments.

To add the Shell plug-in steps to processes, click Scripting > Shell in the step palette of the process editor.

Compatibility

This plug-in requires IBM UrbanCode Deploy version 6.0.1 or later.

The steps in this plug-in run on any agents that the IBM UrbanCode Deploy server supports.

Installation

No special steps are required for installation. See Installing plug-ins in UrbanCode Deploy.

History

Version 7.800043

Version 7 of the plug-in includes a fix for APAR PI40728. The Shell (with xargs) step now correctly displays the arguments in the logs.

Version 6.785165

Version 6 includes a fix for APAR PI35342. The plug-in is now compatible with IBM UrbanCode Deploy version 6.1.0.4 and later.

Version 5.562693

Version 5 includes a fix for a defect where the Shell plug-in was not upgraded when users upgraded to IBM UrbanCode Deploy 6.1.0.2.

Usage

With the Shell plug-in steps, you can run a Shell script as part of the deployment process. The plug-in step contains the scripts.

The steps in this plug-in wait until the command is complete. For best results, run commands that complete or run the commands in the background. If a command runs indefinitely, the step and the process that contains the step wait indefinitely.

The commands for each step share stdout and stdin streams. If you use a command or script that runs other commands, each of those commands uses the same stdout and stdin stream as the first command or script. The step waits for all commands to finish.

Each step runs in its own shell. For example, if you set a system variable in one step, future steps do not have access to the variable because they are running in a new instance of the shell.

If one shell script calls another shell script, starting a child process, this child process inherits the file descriptors of the parent process, such as input and output streams. If the parent shell script exits but the child process does not, the step continues, waiting for output from the child process. To make sure that the step can end normally, redirect the output and error streams for the child process. For example, if the child process is child.sh, you can redirect the output and error streams with the following code:

child.sh < /dev/null > tempout 2>&1
cat tempout

Step palette

To access this plug-in in the palette, click Scripting > Shell.

Steps

Process steps in the Shell plug-in

Shell

Use this step to run a shell or batch script.

Input properties for the
Shell step
Name Type Description Required
Daemon Boolean If this property is enabled, the command runs in the background while it permits the step to complete immediately. The output is not captured if the command runs as a daemon. No
Directory Offset String The working directory to use when you execute this command. This directory is relative to the current working directory. Yes
Interpreter String The interpreter to use to evaluate the command. If this property is left blank the following platform-specific interpreters are used:
Windows: .bat file interpreter
VMS: .com file interpreter
Other: The shell that is specified by the air/shell agent variable if it is present. Linux and UNIX systems might override this setting by having the command line start with a #! sequence.
No
Output File String Specify this property only if the Daemon property is enabled. The path of the file to which the command output is directed. To discard the output, leave this property blank. The output is captured if an output file is specified. No
Shell Script String The script code to execute. Yes

Shell (with xargs)

Use this step to run a shell or batch script a number of times equal to a multi-valued input.

Input properties for the
Shell (with xargs) step
Name Type Description Required
Daemon Boolean If this property is enabled, the command runs in the background while permitting the step to complete immediately. The output is not captured if it runs as a daemon. No
Directory Offset String The working directory to use when you execute this command. This directory is relative to the current working directory. Yes
Interpreter String The interpreter to use to evaluate the command. If this property is left blank the following platform-specific interpreters are used:
Windows: .bat file interpreter
VMS: .com file interpreter
Other: The shell that is specified by the air/shell agent variable if it is present. Linux and UNIX systems might override this setting by having the command line start with a #! sequence.
No
Once Per Arg Boolean Run the script once for each argument in the xargs property. No
Output File String The path of the file to which the command output is directed. To discard the output, leave this property blank. The output is captured if an output file is specified. No
Shell Script String The shell script code to execute. Yes
xargs String The list input value to the script. Separate each value with the delimiter that is specified in the delimiter property. Yes
xargs delimiter String The delimiter that is used to separate the input values to the script. The default delimiter used is the comma (,). Yes