Quicksilver hooks into platform workflows to automate your Pantheon WebOps workflow. This allows the platform to run selected scripts automatically every hour, or when a team member triggers the corresponding workflow. There is a growing set of example scripts that you can contribute to. You can also find examples to enable functionality like chat-ops, database sanitization, deployment logging, and automated testing operations with a CI server.
Set up existing scripts and write your own with help from our experts. Pantheon delivers on-demand training to help development teams master our platform and improve their internal WebOps.
For example, committing a pantheon.yml file with the following contents to the root of your site's code repository with the script adapted from slack_notification will post to Slack every time you deploy:
api_version: 1 workflows: deploy: after: - type: webphp description: Post deployment notification to Slack script: private/scripts/slack_deploy_notification.php
Add the following after the previous snippet to have it automatically log the deployment to New Relic:
- type: webphp description: Log to New Relic script: private/scripts/new_relic_deploy.php
Specify the workflows you want to hook into (e.g.,
sync_code) the workflow stage (
after) and the location of the script relative to the root of your site's docroot.
Before using a Quicksilver hook for a deploy workflow, deploy your
pantheon.yml file into an environment.
Quicksilver scripts that trigger on the deploy hook operate on the state of the code at the time of the deploy, not the state of the code after the deploy. This means that new or updated code is not available until the deployment finishes even though the deploy hook is triggered at the start of the deploy.
Quicksilver currently supports
webphp scripting, which runs a PHP script through the same runtime environment as the website. PHP scripts are subject to the same limits as any code on the platform, such as timeouts. PHP scripts cannot be batched, and run continuously and sequentially. Each command executes after the previous command has finished or timed out.
We recommend setting the
true to create a dedicated directory in the docroot (for example,
private/scripts). This tracks files by instructing Quicksilver to look for the files inside the
web folder. If your site uses this nested docroot setting, the scripts directory must be located in the
web subdirectory of your site's code repository (for example,
If your site uses a nested docroot, the script paths in your
pantheon.yml file should not include the
web/ path prefix. Scripts in your
pantheon.yml file should match the following path examples:
You can use Terminus to install Quicksilver Composer scripts if you have a Composer-managed site. The sections below provide links to Pantheon-maintained repositories with install scripts.
Your script may require tokens, passwords, or other information that should be protected. These values should be stored securely. You can do this with a third-party key management service like Lockr.
You can also use your site's private files path to store values securely. When storing keys for Quicksilver scripts in the private files path, be aware that the Site Dashboard function to copy files from one environment to another will also overwrite the private files path.
Install the Terminus Secrets Plugin to manage secret data in JSON files in your site's private files path.
This will allow you to write and remove key values. The code example below shows you how to write a value to a key:
terminus secrets:set site.env key value
Use the Pantheon Cloudflare Cache repository to clear your Cloudflare cache.
Always clear your CDN cache using the
after timing option to avoid requests re-caching stale content. Caches should generally be cleared "bottom up".
Use the Pantheon Quicksilver Debugging repository to explore Quicksilver as a workflow improvement tool.
The Pantheon Drush CMI repository provides steps on how to integrate Drush commands into your Quicksilver operations. This allows you to import configuration changes from
The Pantheon Drush Revert Features repository provides information on using Drush to commands to revert specific features.
The Pantheon Enable Development Module repository provides steps on how to use Drush within a Quicksilver script.
Use the Pantheon Generate Development Content repository to integrate Drush devel generate commands into your Quicksilver operations. This allows you to generate development content on each database clone operation.
Use the Pantheon WP-CFM Import repository to automatically import WP-CFM configuration settings into a cloned database. This is useful for development environments that have slightly different settings than the production environment.
WP-CFM should only be used to write changes to code in Dev and Multidev environments, where the code base is writable. Cloning databases between environments before saving WP-CFM bundles can result in loss of data.
Use the Pantheon New Relic Apdex T Values repository to set custom T values for Multidev environments. Each environment will use the default values of 0.5 and 7 for your server and browser, respectively, if you don't set a custom value.
Use the Pantheon New Relic Deploy Markers repository to automatically log changes to your site into New Relic's Deployments page. This can be useful for keeping track of performance improvements.
Use the Pantheon Search and Replace URLs on WordPress Sites repository to automatically find and replace URLs in the database of a WordPress website. This is helpful for sites that have multiple domains in an environment.
Use the Pantheon Slack Integration repository to integrate Slack notifications from your Pantheon project using Quicksilver. This integration overview also provides information on how to manage API keys outside of your site repository.
Use the Pantheon URL Checker repository to check specific URLs after a live deployment. This script also notifies you of failures by email.
Use the Pantheon Quicksilver Webhooks repository to post workflow data to an external URL for a generic Webhook implementation.
You can hook into the following workflows:
|Workflow||Description||Location of webphp runtime||Notes|
|Autopilot Visual Regression test||"Autopilot" Multidev|
|Clear CMS and Edge Cache|
|Clone database between environments||target (to_env)|
|Create Multidev environment||Multidev|
|Deploy code to Test or Live||target|
|Use the command ||Dev or Multidev|
For sites using Integrated Composer, the
sync_code hook runs after the build finishes and the artifacts have been completely deployed to the application server.
Variables are made available through the
$_POST global variable, and the
$_SERVER objects. These variables include the following:
|Variable Name||Description||Hooks Available||Notes|
|The unique ID of the workflow||All|
|UUID of the site instance||All|
|Environment name that the workflow is running on||All||Matches the |
|Description of the workflow as defined in ||All|
|ID of the workflow hook that is running||All|
|Label of the workflow hook that is running||All|
|UUID of the user account that initiated the task||All||If the task is initiated by Pantheon, |
|First name of the user account that initiated the task||All||If the task is initiated by Pantheon, |
|Last name of the user account that initiated the task||All||If the task is initiated by Pantheon, |
|UUID of the user account that initiated the task||All||If the task is initiated by Pantheon, |
|Email of the user account that initiated the task||All||If the task is initiated by Pantheon, |
|UUID of the user that initiated the task||All|
|Target environment where the database is being cloned to|
|Source environment where the database is being cloned from|
|Deploy message provided as part of a test of live deployment||This is only available if a deploy message is provided|
|Result of the visual regression test|
|Page URL associated with an Autopilot VRT result||Autopilot is only available in the new Pantheon Dashboard|
|List of the plugins/modules/themes that were updated prior to the VRT||Returns JSON data structure|
For examples on how to use these variables, see the Quicksilver Examples repository.
Use the following Terminus commands for debugging Quicksilver.
Follow the WebOps activity of your site with
terminus workflow:watch <site>.
List and show previous workflows and their corresponding Quicksilver operations with the following commands:
terminus workflow:list <site>
terminus workflow:info:logs <site> --id=<workflow>
terminus workflow:info:operations <site> --id=<workflow>
terminus workflow:info:status <site> --id=<workflow>
Quicksilver hooks for the
create_cloud_development_environment workflow will not be detected when creating a Multidev environment if the
pantheon.yml file does not exist on the Dev environment. As a workaround, commit the
pantheon.yml file on Dev before creating a Multidev environment.
pantheon.yml file does not exist on the Dev environment, configuration changes will not be detected when creating a Multidev environment. As a workaround, make some modification the
pantheon.yml file and re-commit to the Multidev environment. You will then receive a notice indicating configuration changes have been detected and applied to the Multidev environment:
remote: remote: PANTHEON NOTICE: remote: remote: Changes to `pantheon.yml` detected. remote: remote: Successfully applied `pantheon.yml` to the 'new-feature' environment. remote: remote:
For some Autopilot users, Quicksilver hooks are not detected due to timing issues with Multidev creation. If your Quicksilver
autopilot_vrt scripts are not running, first make sure that your scripts are defined in the Dev environment, and then try deleting your
Autopilot Multidev from the dashboard. Be sure to also delete the
Autopilot branch, and then create the
Autopilot Multidev again in the Dashboard. Once you do this, your scripts should start running after the visual regression tests complete.