To create a new RightScript provide the following information:
Design > RightScripts > New
Name - A short nickname that helps you recognize the script.
Description - Describe the purpose of the script and any required inputs parameters that need to be defined. The description field is optional and does not affect the script's behavior.
Packages - A space-separated list of packages to install on the server. (ex: "mysql-server mysql-devel perl-DBD-MySQL mysqlclient14") At boot time, the package lists of all RightScripts attached to the server are linked together and installed in one invocation of the package manager (typically yum).
Inputs - A RightScript can be parameterized by specifying a number of inputs that need to be provided to the script for its operation. These inputs can come from a number of sources: user, server template, meta-data about the server or other servers, and the credentials attached to the account. The inputs are passed to the script as environment variables.
Identify - Click the Identify button to detect any environment variables that were declared in the Script field below. By default, all references of the form $ALL_CAPS are automatically identified as potential input parameters.
Script - The script is typically a Bash, Perl, or Ruby script. It's best to keep the code short. Long and complex programs should be defined as an attachment and placed into a library. If the script starts with '#!' the named executable will be invoked (standard Unix convention). If no '#!' is provided, then "/bin/bash -e" is used. Note that scripts should signal failure by using a non-zero exit code. This will stop the application and cause the server to be marked as "stranded" so that an operator can take corrective action.
A RightScript is an executable piece of code that can be run on a server. RightScripts consist of changes that can be run on a server during the boot, operational, or shutdown phases. They cannot be run on a "stranded" server. A RightScript consists of a script (typically written in Bash, Ruby, or Perl), a set of attachments that are downloaded from S3, a set of packages that are installed using the system's package manager (yum in the case of Red Hat-based systems), and a set of input parameters that must be passed into the script. In order to use RightScripts on a server, a ServerTemplate must be created, the RightScript(s) must be added to the template, inputs must be provided, and lastly a server must be launched.
The following operational buttons exist from this page:
Design > RightScripts > Index
New - Create a new RightScript from scratch.
Diff - Compare two RightScripts or multiple revisions of the same RightScript.
Merge - Merge the differences of two RightScripts together into one RightScript. Perform a 3-way merge of RightScripts. For example, let's say you have cloned and customized a public script. When a new revision of the public script is published, you can merge those updates into your customized script.
Search - Search through Private, Shared, RightScale and/or Partner RightScripts for a specific text pattern.
The Private tab shows RightScripts that you've either created yourself or cloned from one of the other tabs. Whenever you clone a RightScript, an editable copy will appear under the Private tab.
(DEPRECATED-No longer being used. In the Library) RightScripts Index > Private tab
The Partners tab displays all of the RightScripts that are published and supported by RightScale partners. These RightScripts are used across all of our Partner's ServerTemplates, so you may find the filter and search tools useful for finding a particular script.
RightScripts Index > Partners tab
The RightScale tab displays all of the RightScripts that are published and supported by RightScale. The RightScripts are used across all of RightScale's published ServerTemplates. However, you can use these RightScripts to create a custom ServerTemplate of your own. In order to make any changes to a published RightScript, you will first need to clone it, which will add an editable copy under the Private tab.
(DEPRECATED-No longer being used. In the Library) RightScripts Index > RightScale tab
The Shared tab displays all of the RightScripts that have been shared with you from other RightScale users. The ability to create sharing groups and share ServerTemplates, RightScripts, and Macros is reserved for users of our Premium and Enterprise editions. When you accept an invitation to a sharing group, you gain access to all of that group's shared objects (ServerTemplates, RightScripts, Macros), which will appear under their respective shared tabs.
(DEPRECATED-No longer being used. In the Library) RightScripts Index > Shared tab
A RightScript is an executable piece of code that can be run on a server. RightScripts consist of changes that can be run on a server during the boot, operational, or shutdown phases. RightScale provides a number of RightScripts that are available to users based on their subscription level. The Revision bar allows you to see the most recently committed revisions and [HEAD] version of a RightScript. Click the Revision button to view an exhaustive list of all committed revisions (Revisions tab).
Design > RightScripts > Show
Clone - Clone a RightScript to make an editable copy that you can customize for your own needs. Cloned RightScripts will be added under the Private tab.
Commit - You can only commit a [HEAD] revision of a script. Commit a RightScript to create a static revision of the current version of the script. As a best practice, you should only use committed revisions of a script in a production deployment in order to prevent against accidental changes to the script.
Delete - Permanently delete a RightScript and all of its revisions. The delete button will only appear when viewing the HEAD version of a RightScript. As a safety precaution, you can only delete your own RightScripts (Private tab) where neither a previously committed revision nor HEAD version is being referenced/used by a ServerTemplate. You also cannot delete a particular revision of a script. Check the cross reference section under the script's Info tab to view which ServerTemplates are referencing the RightScript. Once the RightScript is no longer used in any ServerTemplates, it can be deleted.
Copy to Head - When viewing a previously committed revision of a script, click the "Copy to Head" action button to make it the new HEAD version of your script.
Diff - Perform a diff between the currently viewed RightScript version and either a different revision of the same script or of a completely different script. The resulting output window displays the two user specified RightScripts in parallel, color coding all added (green), removed (red) and modified (blue) attributes.
Merge - After performing a diff, you may want to merge the changes between the RightScripts together.