Add A Pipeline Step¶
Pipeline steps are individual and reusable actions that are used to construct deployment workflows in Cascade. Steps are added to pipelines to be executed.
Each project type is bundled with steps that implement the standard workflows Cascade provides to move code between the available environments.
Note: In older versions of Cascade, Steps are called Actions; however, the features are functionally equivalent and the terms are used interchangeably in this documentation.
In addition to the bundled steps, you can add custom ones to automate repetitive tasks related to deploying code. Some examples of common steps we see our users add:
- Run Drush cache clear in Production environment
- Reload Apache Configuration in Development Environment
- Run Composer Install in Staging Environment
Prerequisites¶
You will need to log into Cascade as a Project Administrator to add Pipelines. In order to check your permissions, please navigate to the overview page of the project you wish to modify and click the pipelines icon ( ). Once the pipelines page loads, click the Actions tab to the right of the Pipelines tab to open the Actions dashboard. You should see the actions display below. If your display does not include a plus-sign ( ) next to the actions header your account does not have sufficient privileges to proceed.
Add A New Pipeline Step¶
Pipeline steps are available to every project and listed in the Actions dashboard. Start out by navigating to the Overview dashboard within a project where your account is a Project Administrator. From there, click the pipelines icon within the left-side toolbox ( ) and click Actions tab. This will cause the Actions dashboard to display.
Remember that steps are executed by Pipelines, and you can find more information on how to do that in the Add A Pipeline guide.
Step 1: Select Step Type¶
The first decision is selection of step type. Cascade supports three different step types of step to accommodate a variety of automation needs. The form shown will look like the screenshot below. Read through this section to familiarize yourself with the available options.
- Click the + icon to the right of the ACTIONS header, the type selection form will appear.
- Select one of the available options: File Template, Script, or Service.
- The step details form should be shown automatically, if not, click the create button.
File Template¶
Search and replace tokens in a text file on machines connected to Cascade.
Common uses:
- environment specific database configuration
- runtime variables
Script¶
Run a shell script on machines connected to Cascade.
Common uses:
- Composer update or install in development environments
- Drush updates and cache clears
- NPM install or update
Service¶
Control a service on machines connected to Cascade.
Common uses:
- Reload Apache configuration or restart the Apache service
- Restart Redis, Solr, or other resident stack components
Step 2: Add Common Properties¶
All steps share a common set of properties that name the step and tell Cascade where in the systems the step should be run. Steps can have a name and must target a Deployment Group in a single Environment.
- Enter the Step Name of your choice.
- Select a Target Environment available from this project.
- Select the Deployment Group this step applies to.
Step 3: Add Type-Specific Details¶
Each step has some options that are unique to the type, follow the section below that applies to the type you have chosen.
File Template Details¶
You will need the full path to the file, typically this is a path inclusive of the web root for your project which can be found in the Code configuration for the project.
- Enter the full file path to the file you would like to alter.
- Enter search and replace values.
- Click the Create button to save the step.
The following example replaces DATABASENAME with dev_db in Development Code environment inside a settings.local.php file.
Script Details¶
Use good practice for shell scripting. Example: declare the interpreter and be defensive. Script errors will be shown in the project history to aid in debugging. Please note that we do not pass any Cascade variables to your script and do not set the working directory for you.
- Enter the contents of a shell script.
- Click the Create button to save the step.
The following example runs a composer install command against the Production Code environment.
Service Details¶
Knowledge of your hosting environment is required, if you have questions about the OS you are using or names of services refer to documentation Contegix provides or reach out to the support team.
- Enter the Service Name you want to control.
- Select the Service action you wish to invoke from the available options: Stop, Start, Restart, Reload
- Click the Create button to save the step.
This example reloads the Apache configuration in the Development Code environment for a CentOS machine.
Add A Step To An Existing Pipeline¶
Both new and existing steps must be added to a pipeline to be executed. Keep in mind that the ordering of the steps within a pipeline workflow represents the order of execution.
Navigate to the Pipelines dashboard ( ) for the Project you are working in.
Find the Pipeline you are extending in the list, and on the right side of the row, click on the vertical ellipsis and then Edit.
The Pipeline Edit form will appear, find the step you want to add it to the workflow by grabbing it with our mouse pointer and dragging it into right pane.
After you have selected the step you may alter the order of execution by dragging items around in the right pane.
Click the Save button at the bottom to complete your change.