With BMC Release Process Management (RPM), you can automate manual tasks for deploying an application. To deploy components of an application in the specified environment, you create requests. These requests consist of sequential steps that execute the deployment process. During the execution of steps, you might perform manual or repetitive tasks. In some cases, you might need to switch to another application to execute a step. You can automate these steps by using default or writing your own automation scripts.
In RPM 5.0, you can write automation scripts both in Ruby and any other programming language as long as its interpreter is present in the system that runs the appropriate step.
By default, all automation scripts are divided into the following types:
Data retriever—Automation scripts in the Ruby programming language that run on the target servers to obtain the necessary configuration data.
Note
When you upgrade RPM from 4.6.x or earlier to 5.0.x, resource automation scripts from your previous product version are transferred into 5.0.x as data retriever scripts.
Local ruby—Automation scripts in the Ruby programming language that run on the agent host of the engine that starts an automation step.
Note
When you upgrade RPM from 4.6.x or earlier to 5.0.x, automation scripts from your previous product version are transferred into 5.0.x as local ruby scripts.
Remote dispatcher—Automation scripts in the Ruby programming language that run on the engine server. They implement various transport protocols (agent types) for transferring files and executing scripts on remote servers.
Remote dispatcher scripts are executed based on the agent type of the target server.
Note
Automation scripts that use server references in a package do not work in steps.
You can also create custom automation types.
To use automation, you must first enable automation functionality in RPM.
Log in to RPM as a user with permissions to access the Settings option under the System tab.
By default, all automation scripts are run on JRuby. For Local Ruby automation scripts, you can use an alternate Ruby interpreter.
Best practice
In the file, add the $AUTOMATION_RUBY_PATH
parameter with the full path to the executable file of the installed alternate Ruby interpreter.
Example
$AUTOMATION_RUBY_PATH = "/opt/alternateRuby/bin/ruby"
Save the file.
Restart the RPM services.
To use the alternate Ruby interpreter, you must specify the alternate_ruby
parameter with the value set to true
in each Local Ruby script that you want to run on the interpreter.
Example
###
# command:
# name: Name of command
# success:
# name: Term or Phrase to indicate success
###
#============== User Portion of Script ==================
# Run the command directly on the localhost
result = run_command(params, params["command"], '')
params["alternate_ruby"] = true
params["success"] = params["success"] || ""
# Apply success or failure criteria
if result.index(params["success"]).nil?
write_to "Command_Failed - term not found: [#{params["success"]}]\n"
else
write_to "Success - found term: #{params["success"]}\n"
end
Open the appropriate script and delete the line with params["alternate_ruby"] = true
.
Warning
Commenting the line or setting the alternate_ruby
parameter to false
does not disable alternate Ruby.