Scripts
CloudRay scripts provide a powerful way to automate tasks on your remote servers. Using flexible Liquid templates, you can customize script execution, reuse scripts across different scenarios, and enhance deployment efficiency.
Key features of the CloudRay Scripts include:
- Automate repetitive tasks (e.g., deployments, backups, and configurations)
- Uses Liquid templates for dynamic script execution
- Manage scripts centrally and execute them across multiple servers
Creating CloudRay Scripts
CloudRay allows you to define and manage automation scripts that can be executed on your remote servers. Follow these steps to create a new script and customize it:
- Navigate to “Scripts”: Click on the “New Script” tab in the main navigation

- Enter Details: Start creating a new script template

- Script Name: Provide a descriptive name for your script (e.g., “Deploy Website”, “Backup Database”)
- Template: Write your script using a combination of Bash commands, Python code, or any language executable via SSH, and Liquid template variables
- Save Script: Click “Save Script” to store your script template
Using Liquid Templates for Dynamic Scripts
CloudRay supports the Liquid templating language, allowing you to include dynamic content in your scripts. This is useful for injecting server-specific variables and logic during script execution.
Built-in CloudRay Variables
These variables are automatically available in your scripts
Variable | Description |
---|---|
{{ cr.server_name }} | The name of the server where the script is running |
{{ cr.server_ssh_host }} | The hostname or IP address of the server |
{{ cr.script_name }} | The name of the currently executing script |
{{ cr.webhook_query_params }} | If triggered by a Webhook Receiver, this contains URL query parameters |
{{ cr.webhook_post_body }} | If triggered by a Webhook Receiver, this contains the request body |
Built-in CloudRay Filters
Filters modify the output of variables. CloudRay supports the following
Filter | Description |
---|---|
cr_bash_escape | Escapes a string so it can be safely used in a Bash script |
For Example: {{ user_input | cr_bash_escape }}
ensures that user input doesn’t break your script
Custom Variables (Variable Groups)
You can create Variable Groups within CloudRay to define key-value pairs. These variables can be referenced in your script templates when you create a Runlog.
For more details on managing variable group and running scripts in CloudRay, refer to the Variable Group documentation and Runlogs documentation.
Managing Your Scripts
CloudRay allows you to view, edit, and organize your scripts effortlessly. You can update existing scripts, modify templates, and track changes to ensure your automation stays up-to-date.
Viewing Scripts

To check your available scripts, simply click on the “Scripts” in the list. This will display the list of scrips available in your account
Editing Scripts
If you need to modify your scrips’s details, follow these steps:

- Click “Edit” next to the script you wish to update

- Modify the Script name and its template based on your need
- Click on “Save Script” to save your changes
Using CloudRay scripts, you can automate tasks, manage servers and deploy applications easily.