Back to Top

Ant Script/Code Runner

Class Name com.midvision.rapiddeploy.orchestration.tasks.utils.AntScriptTask
Category Command and Script Execution

Ant Script Runner. Run an ANT Script or define ANT code to run.


Description

This task allows either an ANT script to be called from your orchestration, or you can place the ANT code directly in the antScriptText text area.

If running an ANT script, it may reside on the target server, or may live within the deployable archive (set ${ARCHIVE_ROOT} built in variable followed by the rest of the path to the ANT script inside the deployable archive package).

The antScriptText field may contain any data dictionary parameters which will be replaced with the target specific values at deployment time.

This task uses ANT bundled with RapidDeploy and so there is no need to install ANT on the target server.

Properties

You may set target specific ANT properties, used by your ANT script, in the Entries section of this task. Choose the type of PROPERTY and enter a name/value pair for each property used in your ANT script. You may use data dictionary parameters in the value to allow differing property settings for different targets.

Resources

The following resources may be set on this task:

Table of task Resources

Name Type Default Value Optional Description
antScriptPath java.lang.String   true The full path to the ANT script. If the script is to be run from inside the project deployment package, reference the path using ${ARCHIVE_ROOT}/path/to/script/folder.
antScriptText TextArea   true The ANT script text to execute. This will start with a <project> element and end with a </project> element.
failOnError java.lang.Boolean true false This task will not fail the deployment on error if set to false.
outputParameter java.lang.String ${antOutput} true The name of the output parameter, which can pass the return value from the task. This tasks output will be the script contents. Define a unique parameter name starting with '${', ending with '}' for the whole orchestration (latter tasks can override the parameter value if the same parameter name is specified). You can refer to this parameter in any task below in the tasklist, as an input parameter ${antOutput}.
skipOnFailure java.lang.String Previous Task Name true Skip current task based on the name of the previous task whether has failed or not.
target java.lang.String default true The ANT target to run.


Back to Top

Command Runner

Class Name com.midvision.rapiddeploy.orchestration.tasks.LocalCommandRunnerTask
Category Command and Script Execution

Command Runner Task. Run a command on the target.

Description

Runs the given command on the target machine.

Examples

scriptAndArgs is a comma separated list comprising the command to run and any arguments.
Windows Examples:
 
                     			cmd,/c,echo LocalCommandRunnerTask001 test
                     			cmd,/c,c:/Program Files/RDScripts/helloWorld.bat,@@SHAPE@@,@@COLOUR@@,@@SIDES@@
                     			
Unix Examples:
 			
                     			/bin/bash,-c,/bin/ls -lrt
                     			/bin/sh,-c,/bin/ps -ef | /bin/grep PROCESS_STRING | /bin/grep -v grep 
                     			
Example with nohup. In this case we want the server start to survive the deployment, so we use 'nohup' and '&'. We redirect the output to /dev/null to prevent the output from the command holding a lock on the shell and preventing the task from ending.
 			
                     			/bin/sh,-c,nohup command > /dev/null 2>&1 &
                     			

Resources

The following resources may be set on this task:

Table of task Resources

Name Type Default Value Optional Description
errorString java.lang.String   true If this string is set on the task, then the output stream is searched (case insensitive) for this string. If it is found then the task will fail. Useful for commands that alway exit with an exit code of 0, does not have an exit string and does not write errors to standard err and you are looking for a specific output.
exitString java.lang.String   true If this string is encountered in the output stream, the command execution will be terminated.
failOnError java.lang.Boolean true false This task will not fail the deployment on error if set to false.
scriptAndArgs java.lang.String cmd,/c,echo test false Comma separated list consisting of command, arguments. Win Example: cmd,/c,echo LocalCommandRunnerTask001 test Unix Example: /bin/bash,-c,/bin/ls -lrt
skipOnFailure java.lang.String Previous Task Name true Skip current task based on the name of the previous task whether has failed or not.
successString java.lang.String   true If this string is set on the task, then the output stream is searched (case insensitive) for this string. If it is not found then the task will fail. Useful for commands that alway exit with an exit code of 0 and do not write errors to standard err and you are looking for a specific output.


Back to Top

Command Runner With Response

Class Name com.midvision.rapiddeploy.orchestration.tasks.LocalCommandRunnerWithResponseTask
Category Command and Script Execution

Command Runner which returns the script return value as an output parameter.

Description

Command runner task. Runs the given command on the target machine.

Examples

scriptAndArgs is a comma separated list comprising the command to run and any arguments.
Windows Examples:
 
                     			cmd,/c,echo LocalCommandRunnerTask001 test
                     			cmd,/c,c:/Program Files/RDScripts/helloWorld.bat,@@SHAPE@@,@@COLOUR@@,@@SIDES@@
                     			
Unix Examples:
 			
                     			/bin/bash,-c,/bin/ls -lrt
                     			/bin/sh,-c,/bin/ps -ef | /bin/grep PROCESS_STRING | /bin/grep -v grep 
                     			
Example with nohup. In this case we want the server start to survive the deployment, so we use 'nohup' and '&'. We redirect the output to /dev/null to prevent the output from the command holding a lock on the shell and preventing the task from ending.
 			
                     			/bin/sh,-c,nohup command > /dev/null 2>&1 &
                     			

Resources

The following resources may be set on this task:

Table of task Resources

Name Type Default Value Optional Description
errorString java.lang.String   true If this string is set on the task, then the output stream is searched (case insensitive) for this string. If it is found then the task will fail. Useful for commands that alway exit with an exit code of 0, does not have an exit string and does not write errors to standard err and you are looking for a specific output.
exitString java.lang.String   true If this string is encountered in the output stream, the command execution will be terminated.
failOnError java.lang.Boolean true false This task will not fail the deployment on error if set to false.
outputParameter java.lang.String ${output} true The name of the output parameter, which can pass the return value from the task. The task output will be the script output value. Define a unique parameter name starting with '${', ending with '}' for the whole orchestration (latter tasks can override the parameter value if the same parameter name is specified). You can refer to this parameter in any task below in the tasklist, as an input parameter ${output}.
scriptAndArgs java.lang.String cmd,/c,echo test false Comma separated list consisting of command, arguments. Win Example: cmd,/c,echo LocalCommandRunnerTask001 test Unix Example: /bin/bash,-c,/bin/ls -lrt
skipOnFailure java.lang.String Previous Task Name true Skip current task based on the name of the previous task whether has failed or not.
successString java.lang.String   true If this string is set on the task, then the output stream is searched (case insensitive) for this string. If it is not found then the task will fail. Useful for commands that alway exit with an exit code of 0 and do not write errors to standard err and you are looking for a specific output.


Back to Top

Java Command Runner

Class Name com.midvision.rapiddeploy.orchestration.tasks.utils.JavaExecTask
Category Command and Script Execution

Java Command Runner.

Description

Java Command Runner task. Runs the given command on the target machine.

Usage

You may specify either a jar file to run (jarFile resource) or a class (class resource), which must in either case have a main method defined either in the manifest of the jar or in the specified class.

Multiple java properties can be specified using the javaProperties resource. E.g. -Xms256m -Xmx768m -Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10

You may specify any arguments your main method expects using the 'arguments' resource.

Environment Variables

You may set target specific Environment Variables, used by your applications(s), in the Entries section of this task. Choose the type of VARIABLE and enter a name/value pair for each variable used in your script(s). You may use data dictionary parameters in the value to allow differing property settings for different targets.

Resources

The following resources may be set on this task:

Table of task Resources

Name Type Default Value Optional Description
arguments java.lang.String   true Space separated list of arguments expected by your applications main method.
class java.lang.String   true The class to run. This class must exist in the classpath and must contain a main method
classpath java.lang.String   true The classpath required by this application. Classpath entries should be separated by a colon(:) on Linux and a semi-colon(;) on windows.
failOnError java.lang.Boolean true false This task will not fail the deployment on error if set to false.
jarFile java.lang.String   true The path to the jar file to run. Must contain a Main method defined in the MANIFEST.MF file.
javaHome java.lang.String   true Path to JAVA_HOME of the java installation on the target server. If left blank, defaults to the JAVA_HOME used by this orchestration.
javaProperties java.lang.String   true The set of java properties required by this application. The properties are separated by a space e.g. -Xms256m -Xmx768m -Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10
outputParameter java.lang.String ${output} false The name of the output parameter, which can pass the return value from the task. The task output will be the java application output to STDOUT. Define a unique parameter name starting with '${', ending with '}' for the whole orchestration (latter tasks can override the parameter value if the same parameter name is specified). You can refer to this parameter in any task below in the tasklist, as an input parameter ${output}.
outputResult java.lang.String ${outputResult} false The name of the output parameter, which holds the text string output from the task. The outputResult will be true if the java application returns without error. The outputResult will be false if an error occurs. Define a unique parameter name starting with '${', ending with '}' for the whole orchestration (later tasks can override the parameter value if the same parameter name is specified). You can refer to this parameter in any task below in the tasklist, as an input parameter ${outputResult}.
skipOnFailure java.lang.String Previous Task Name true Skip current task based on the name of the previous task whether has failed or not.


Back to Top

Script Code Runner

Class Name com.midvision.rapiddeploy.orchestration.tasks.RunDefinedScriptTask
Category Command and Script Execution

Script Code Runner - Run any script language code from within the RapidDeploy orchestration

Description

Task to allow you to define, in the orchestration task text area directly, the contents of a script (put your script into "scriptToRun" resource) In this way you don't need to actually call a script, but can define the contents directly in a text area in the task. The script is written out to a temp location and run. Then deleted.

Usage

You can specify the type of script using the hashbang at the top of the script. Some examples follow:
                     			#!/bin/sh				Shell script
                     			#!/bin/ksh				Korn shell script
                     			#!/bin/bash				Bash script
                     			#!/usr/bin/python		Python script
                     			#!/usr/bin/env python   Execute using Python by looking up the path to the Python interpreter automatically via env
                     			#!/usr/bin/ruby			Ruby script
                     			#!/opt/local/bin/perl	Perl script
                     			
                     			

Environment Variables

You may set target specific Environment Variables, used by your script, in the Entries section of this task. Choose the type of VARIABLE and enter a name/value pair for each variable used in your script. You may use data dictionary parameters in the value to allow differing property settings for different targets.

Resources

The following resources may be set on this task:

Table of task Resources

Name Type Default Value Optional Description
failOnError java.lang.Boolean true false This task will not fail the deployment on error if set to false.
outputParameter java.lang.String ${output} true The name of the output parameter, which can pass the return value from the task. The task output will be the script output value. Define a unique parameter name starting with '${', ending with '}' for the whole orchestration (latter tasks can override the parameter value if the same parameter name is specified). You can refer to this parameter in any task below in the tasklist, as an input parameter ${output}.
scriptArgs java.lang.String   true Arguments to pass to the script.
scriptBaseDir java.lang.String ${TMP_DIR} true The path to the directory where the script will be executed. By default is uses the system temp directory.
scriptToRun TextArea   false Script language code that you want to run on target server. Enter the script code here for Korn shell, Bourne shell, Bash, Perl, Python, Ruby etc.
skipOnFailure java.lang.String Previous Task Name true Skip current task based on the name of the previous task whether has failed or not.
successCode java.lang.String 0 false The expected return code indicating success. Normally, this should be left as 0.


Back to Top

Script Runner

Class Name com.midvision.rapiddeploy.orchestration.tasks.LocalScriptRunnerTask
Category Command and Script Execution

Script Runner Task.


Description

Runs the given script on the target machine. The output of the script is returned from the task in the defined outputParameter.

The script may reside on the target server, or may live within the deployment package. If the script(s) is/are to be run from inside the project deployment package, reference the path using ${ARCHIVE_ROOT}/path/to/script.

Environment Variables

You may set target specific Environment Variables, used by your script, in the Entries section of this task. Choose the type of VARIABLE and enter a name/value pair for each variable used in your script. You may use data dictionary parameters in the value to allow differing property settings for different targets.

Windows Specifics

scriptToRunPath on windows may include spaces. Normally this should not be an issue.
For example:
scriptToRunPath	c:/temp/Test Folder/helloWorld.bat
works as expected. Note that the path is not quoted.
If you do have difficulties, run
dir *. /x
in the directory containing the directory with spaces.
This will identify the space-free alias as follows:
24/05/2012  21:07    DIR          TESTFO~1     Test Folder
You can then use:
scriptToRunPath	c:/temp/TESTFO~1/helloWorld.bat

Note on Windows Short Names

If you don't see a short name with dir /X on an NTFS file system, try the following: Type this at the prompt to check the setting:
                     			fsutil behavior query disable8dot3
                     			
If it returns disable8dot3 = 1, it has been disabled. You can re-enable it with this command:
                     			fsutil behavior set disable8dot3 0
                     			
Then reboot for the setting to take affect.
This will not change existing files.

Resources

The following resources may be set on this task:

Table of task Resources

Name Type Default Value Optional Description
failOnError java.lang.Boolean true false This task will not fail the deployment on error if set to false.
outputParameter java.lang.String ${output} true The name of the output parameter, which can pass the return value from the task. The task output will be the script output value. Define a unique parameter name starting with '${', ending with '}' for the whole orchestration (latter tasks can override the parameter value if the same parameter name is specified). You can refer to this parameter in any task below in the tasklist, as an input parameter ${output}.
scriptArgs java.lang.String default true Arguments to pass to the script.
scriptToRunPath java.lang.String /tmp/path/to/script false The full path to the script. If the script is in the deployment package, use ${ARCHIVE_ROOT}/path/to/file.
skipOnFailure java.lang.String Previous Task Name true Skip current task based on the name of the previous task whether has failed or not.
successCode java.lang.String 0 false The expected return code indicating success. Normally, this should be left as 0.


Back to Top

Set of Scripts Runner

Class Name com.midvision.rapiddeploy.orchestration.tasks.ExecuteScriptTask
Category Command and Script Execution

Execute a set of Scripts on a target.


Description

Runs the given scripts defined by a target directory (targetDir) and fileset (filesetIncludes, filesetExcludes) on the target machine.

Usage

Filesets are sorted according to a natural ordering comparator. This means that script files will be executed in name order, for example the following files under targetDir matching the filesetIncludes descriptor of '**/*.sh', which matches any file ending in .sh under any folder under the targetDir will be executed in the order shown:
                     				dbscript4.sh
                     				dbscript5.sh
                     				script1.sh
                     				script2.sh
                     				script3.sh
                     				test1.sh
                     				test2.sh
                     				
                     			
You should therefore name your scripts such that they are executed in the desired order.

The scripts to run may reside on the target server, or may live within the deployment package. If the script(s) is/are to be run from inside the project deployment package, reference the targetDir path using ${ARCHIVE_ROOT}/path/to/script/folder.

Environment Variables

You may set target specific Environment Variables, used by your script(s), in the Entries section of this task. Choose the type of VARIABLE and enter a name/value pair for each variable used in your script(s). You may use data dictionary parameters in the value to allow differing property settings for different targets.The environment variables will be set for all scripts run in the fileset.

Windows Specifics

targetDir on windows may include spaces. Normally this should not be an issue.
For example:
targetDir	c:/temp/Test Folder/
works as expected. Note that the path is not quoted.
If you do have difficulties, run
dir *. /x
in the directory containing the directory with spaces.
This will identify the space-free alias as follows:
24/05/2012  21:07    DIR          TESTFO~1     Test Folder
You can then use:
targetDir	c:/temp/TESTFO~1/

Note on Windows Short Names

If you don't see a short name with dir /X on an NTFS file system, try the following: Type this at the prompt to check the setting:
                     			fsutil behavior query disable8dot3
                     			
If it returns disable8dot3 = 1, it has been disabled. You can re-enable it with this command:
                     			fsutil behavior set disable8dot3 0
                     			
Then reboot for the setting to take affect.
This will not change existing files.

Resources

The following resources may be set on this task:

Table of task Resources

Name Type Default Value Optional Description
failOnError java.lang.Boolean true false This task will not fail the deployment on error if set to false.
filesetExcludes java.lang.String   false ANT FileSet Style list of files to exclude.
filesetIncludes java.lang.String **/*.sh false ANT FileSet Style list of files to include.
outputParameter java.lang.String ${scriptsOutput} true The name of the output parameter, which can pass the return value from the task. The task output will be the cumulative script output. Define a unique parameter name starting with '${', ending with '}' for the whole orchestration (latter tasks can override the parameter value if the same parameter name is specified). You can refer to this parameter in any task below in the tasklist, as an input parameter ${output}.
scriptArgs java.lang.String   true Arguments to pass to the script. These will be passed to all scripts in the fileset that are run.
skipOnFailure java.lang.String Previous Task Name true Skip current task based on the name of the previous task whether has failed or not.
successCode java.lang.String 0 false The expected return code indicating success. Normally, this should be left as 0. Any other code will result in this task failing. This will be apply to all scripts in the fileset that are run.
targetDir java.lang.String   true The path to the top level directory containing the scripts to run. The actual files to run are then determined by the file set definition (filesetIncludes and filesetExcludes). If the script(s) is/are to be run from inside the project deployment package, reference the path using ${ARCHIVE_ROOT}/path/to/script/folder.


Back to Top

SQL Script/Code Runner

Class Name com.midvision.rapiddeploy.orchestration.tasks.utils.SQLExecTask
Category Command and Script Execution

SQL Script/Code Runner. Run SQL scripts or define SQL to run.


Description

This task allows an SQL text area or set of scripts defined by a fileset to be called from your orchestration file. You either specify the SQL to run in the sqlText field or specify a directory and fileset of scripts to run.
The sqlText field may contain any data dictionary parameters which will be replaced with the target specific values at deployment time.

Usage

Filesets are sorted according to a natural ordering comparator. This means that SQL files will be executed in name order, for example the following files will be executed in the order shown:
                     				dbscript4.sql
                     				dbscript5.sql
                     				script1.sql
                     				script2.sql
                     				script3.sql
                     				test1.sql
                     				test2.sql
                     				
                     		
You should therefore name your scripts such that they are executed in the desired order.

If running SQL scripts, they may reside on the target server, or may live within the deployment package. If the script(s) is/are to be run from inside the project deployment package, reference the path using ${ARCHIVE_ROOT}/path/to/script.

Resources

The following resources may be set on this task:

Table of task Resources

Name Type Default Value Optional Description
classpath java.lang.String   false The driver class path containing the classes used to connect to the database. For example (Oracle): /Users/user/.m2/repository/com/oracle/ojdbc14/10.2.0.1/ojdbc14-10.2.0.1.jar
connectionUrl java.lang.String   false A valid database URL, conforming to the required syntax. For example (Oracle): jdbc:oracle:thin:@localhost:1521:xe
driver java.lang.String   false The driver class used to connect to the database. For example (Oracle): oracle.jdbc.driver.OracleDriver
errorAction java.util.List abort true Defines what action to take if an SQL statement fails. One of: continue, stop or abort. Default value is: abort - stop execution and abort transaction and throw error. stop - stop execution but don't throw error. continue - log the error but continue to the next statement.
failOnError java.lang.Boolean true false This task will not fail the deployment on error if set to false.
filesetExcludes java.lang.String   false ANT FileSet Style list of files to exclude.
filesetIncludes java.lang.String **/* false ANT FileSet Style list of files to include.
outputParameter java.lang.String ${sqlOutput} true The name of the output parameter, which can pass the return value from the task. The task output will be the script output value. Define a unique parameter name starting with '${', ending with '}' for the whole orchestration (latter tasks can override the parameter value if the same parameter name is specified). You can refer to this parameter in any task below in the tasklist, as an input parameter ${sqlOutput}.
password java.lang.String   false The Password to connect to the database.
skipOnFailure java.lang.String Previous Task Name true Skip current task based on the name of the previous task whether has failed or not.
sqlText TextArea   true The SQL content you want to execute. Start each statement on a new line. End each SQL statement using a semi-colon: ';'
targetDir java.lang.String   true The path to the top level directory containing the SQL scripts to run. The actual files to run are then determined by the file set definition (filesetIncludes and filesetExcludes) If the SQL script(s) is/are to be run from inside the project deployment package, reference the path using ${ARCHIVE_ROOT}/path/to/script/folder.
username java.lang.String   false The Username to connect to the database.
verbose java.lang.Boolean true false Verbose output in the log file.