Hook into platform workflows to automate your Pantheon WebOps workflow. Tell Pantheon which script you want to run, and the platform will run it automatically every time you or another team member triggers the corresponding workflow. View (and contribute) to a growing set of example scripts. 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 custom workshops 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 via the same runtime environment as the website itself. PHP scripts are subject to the same limits as any code on the platform, like timeouts, and cannot be batched. In the future we may add additional types. The commands will run in order, and only execute the next when the previous has finished or timed out.
We recommend setting up a dedicated directory in the docroot (e.g.,
private/scripts) for tracking these files. If your site uses a nested docroot, the scripts directory needs to be located in the
web subdirectory of your site's code repository (e.g.,
You can hook into the following workflows:
|Workflow||Description||Location of webphp runtime||Notes|
|Clear CMS and Edge Cache|
|Clone database between environments||target (to_env)|
|Deploy code to Test or Live||target|
|Push code via Git or commit OSD/SFTP changes via Pantheon Dashboard||Dev or Multidev|
|Create Multidev environment||Multidev|
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, or with a storage solution in your site's private files path.
For the latter, the Terminus Secrets Plugin provides a convenient way to manage secret data in JSON files in your site's private files path.
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.
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: