Note: Please go to docs.rightscale.com to access the current RightScale documentation set. Also, feel free to Chat with us!
Home > Reference Info > Dashboard Help Text > Server_templates > ShowTabs > Scripts

Scripts

Table of Contents

Scripts tab

The Scripts tab shows all of the RightScripts (executable scripts of code) that makeup a ServerTemplate. RightScripts are grouped according to when they are executed. There are three types of scripts: boot scripts (executed in succession at boot time) operational scripts (additional scripts that can be manually executed during runtime), or decommission scripts (scripts that are executed in succession during the shutdown phase). The order of the boot scripts is important. For example, an Apache install script must be listed before another script that changes the its configuration to work with Rails. To rearrange the order of how scripts are executed (boot and decommission), simply drag and drop the scripts. Since operational scripts are executed on-demand and not automatically, the order is irrelevant. For decommission scripts, you should only list scripts that can ALL be executed in less than 120 seconds, otherwise subsequent scripts may not have enough time to complete execution. For example, you should never list the "DB EBS backup" RightScript as a decommission script because it will take longer than 120 seconds to complete. They run as part of the standard Unix shutdown sequence and are automatically invoked when a server is terminated either through the web interface or using the Unix shutdown command.

To learn how to create a RightScript and add it to a ServerTemplate, check out the Intermediate Example.

When a server is operational, you can manually run (execute) any of the scripts regardless of whether it is listed as a boot, operational, or decommission script. You can also use the "Any Script" dropdown menu to select and run a specific RightScript, which is useful for one time execution. Use the Edit button to change the revision of a script or the Show to view the script's code. The New Revision icon next to a RightScript denotes when a more recent revision of that script is available. No action is required. It is simply a reminder notification that you may want to upgrade your script. For example, when RightScale publishes a revised version of that script, you can click the New Revision icon to display the differences between your current script and the most recent revision that's available. And if necessary, you can merge the changes together to upgrade your script to the most recent revision.

If you are viewing an editable (HEAD) version you can perform the following actions:

  • commit [HEAD] RightScripts - This action will update all of the HEAD RightScripts. If a HEAD RightScript has uncommitted changes, a new revision will be created and selected. However, if the HEAD RightScript is identical to the latest committed revision, that revision will be selected and no commit will be made. Note: If you commit a ServerTemplate with HEAD RightScripts you will be prompted to also commit any HEAD RightScripts.
  • update to latest RightScripts - Automatically update all of the flagged RightScripts (orange balls) to the latest published (committed) revisions that are available.
  • Detect Changes in HEAD - Highlight scripts (with a blue ball) that have changes between the committed revision that's being used and its HEAD version (if available). For example, if a script has been modified and you want to use those changes, you might want to commit that script's HEAD version and then update the ServerTemplate to use the latest committed revision. Click the blue ball icon to view a diff between the current revision and HEAD.

As a best practice, any production-ready ServerTemplate should only reference committed (static) revisions of RightScripts. Otherwise, you could edit the HEAD revision of a script and change the functionality of multiple ServerTemplates without any warning. Therefore, when you commit a ServerTemplate, you are prompted to commit any [HEAD] RightScripts in your template (default). You can also be proactive and commit all of the [HEAD] RightScripts in a single action prior to committing the template.

Design > ServerTemplates > Show > Scripts tab
You must to post a comment.
Last modified
08:47, 3 Jun 2013

Tags

This page has no custom tags.

Classifications

This page has no classifications.

Announcements

None


© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.