Skip to content

CI/CD Stages and Jobs

The automatic deployment is set up in your .gitlab-ci.yml file.

This file references your profile.drupal.yml file which contains the definition for the stages in the build process.

Task

This stage contains manual jobs available for copying data and files between environments.

The following jobs are available in this stage:

Backcopy Data

Performs a drush sql:sync from the production environment to the selected target environment, after which the database will be sanitized.

If BACKCOPY_CIM is set to "true" a drush config:import will be run after the database is backcopied to ensure proper environment config is applied.

If backcopying from Production to Dev, user 1 will be unblocked to allow for easier testing and development work.

The default jobs provide you with the ability to backcopy data from Production to QA or Dev.

TIP

This job can only be triggered by clicking the play button in the GitLab CI UI.

Source: task.backcopy-data.drupal.yml

Backcopy Files

Performs a drush rsync from the production environment's files directory to the selected target environment's files directory.

The default jobs provide you with the ability to backcopy files from Production to QA or Dev.

TIP

This job can only be triggered by clicking the play button in the GitLab CI UI.

Source: task.backcopy-files.drupal.yml

Get Config

Performs a drush config:export on the target environment and saves it as an artifact to download.

The default jobs provide you with the ability to download config from Production, QA, or Dev.

TIP

This job can only be triggered by clicking the play button in the GitLab CI UI.

Source: task.get-config.drupal.yml

Get Dev Database

Runs drush sql:dump on the development environment and saves the resulting file as an artifact to download. Data is sanitized before dumping.

TIP

This job can only be triggered by clicking the play button in the GitLab CI UI.

Source: task.get-db.drupal.yml

Build

The build stage runs package manager installers such as composer and npm to download required dependencies and then compiles and minifies the code. Once the code is compiled and ready a build artifacts is saved for use in subsequent stages and jobs.

The following jobs are available in this stage:

Drupal Build

Downloads and compiles all the code required to create a build artifact for the site using composer install and npm install. This job can also compile a theme using npm scripts.

While release build artifacts will not expire, dev build artifacts will be removed after 24 hours.

WARNING

These jobs assume you have npm scripts for theme:build and theme:dev. These jobs are used to compile the theme.

If you do not have either of these in your package.json file, the builds will fail.

The default jobs provide you with the ability to build the Drupal site for either releases or development.

Source: build.drupal.yml

Test

This stage is used to run tests against the compiled build and to perform reference checks prior to deployment.

This stage is reserved for tests which require the code base to be available but don't require a deployed copy of the web application. For example unit test can be run during this stage.

Drupal Coding Standards

Runs PHP Code Sniffer on the build artifact to ensure all custom PHP code passes the coding standards. For more information see PHP coding standards.

The default jobs provide you with the ability to build the drupal site from release or dev.

Source: code-test.drupal.yml

Scripts Coding Standards

Runs ESLint on the code base to ensure all custom JavaScript code passes the coding standards. For more information see JavaScript coding standards.

Source: code-test.scripts.yml

Pre Deploy

This is an optional stage which is triggered when required for feature branches, and for the dev branch if the DF_INITIAL_SETUP environment variable is set to true.

This stage is used to set up the web application for the first time. It will deploy the code, set the database credentials and perform a fresh install.

This stage will be triggered automatically (if required) for feature and development branches. Set the following variable to trigger this stage for the dev branch:

  • DF_INITIAL_SETUP=true

WARNING

This stage destroys any data on the remote target.

The following jobs are part of this stage:

Initial Deploy Feature

This job is run to set up a feature environment based on a feature branch. This job is only triggered if CI_INITIAL_SETUP is set to true and the deployment pipeline was triggered by a change to a branch other than the 8.x-1.x branch.

Source: deploy.drupal.yml

Deploy Feature Stop

Clean up feature environment.

Source: deploy.drupal.yml

Initial Deploy Dev

This job is run to set up a development environment. This job is only triggered if CI_INITIAL_SETUP is set to ‘true’ and the deployment pipeline was triggered by a change to the 8.x-1.x branch.

::: Warning This stage will destroy any data on the remote target. :::

Source: deploy.drupal.yml

Deploy

The deploy stage downloads artifacts generated during the build stage and copies the files to a target server.

By default, Dropfort Build provides four different deploy jobs: feature, dev, qa, and prod.

Feature Branch Deployment

Feature branches are copies of the development enviornment used to implement new features without worrying about your work being pushed upstream to other environments.

This job runs automatically every time new commits are pushed to a branch that is not the development branch.

A link to the feature environment is provided in the update stage.

Source: deploy.drupal.yml

Dev Deployment

The development environment is automatically deployed every time new commits are pushed to the development branch.

Valid development branch names can be found in the environments file.

Source: deploy.drupal.yml

QA Deployment

The QA environment is automatically deployed whenever a pre-release tag is pushed to the repository.

Valid pre-release tags can be found in the environments file.

Source: deploy.drupal.yml

Prod Deployment

The Production environment is set up to deploy whenever a release tag is pushed to the repository.

Valid release tags can be found in the environments file.

TIP

This job can only be triggered by clicking the play button in the GitLab CI UI.

Source: deploy.drupal.yml

Update Data

This stage is used for tasks such as database updates, migrations or other tasks related to data changes which require the new code to already be in place.

The following jobs are defined for Update Data stage: update feature, update dev, update qa, update prod.

Source: update.drupal.yml

Post Update

This stage is used for running migrations.

The following jobs are defined for Update Data stage: update feature, update dev, update qa, update prod.

TIP

These jobs are allowed to fail.

Source: post_update.migrate.yml

Pre Validate

This stage is used for tasks which must occur after new configuration has been applied but may be required by validation tests. For example updating search indexes or running data migrations.

The following jobs are defined for Pre Validate stage: update search feature, update search dev, update search qa, update search prod.

Source: pre_validate.search.yml

Validate

The validation stage is used to check the quality and consistency of the deployment. During this stage, automated tests are run to verify the functionality and the look and feel of the updated site to confirm it was deployed properly. This stage is different from the Test phase as these tests are performed on a live remote site.

The following jobs are available in this stage:

Validate Acceptance

Acceptance tests are run using Codeception to ensure that the site is functioning as expected.

The following jobs are defined for Validate acceptance stage: validate feature acceptance, validate dev acceptance, validate qa acceptance, validate prod acceptance.

Source: validate.acceptance.drupal.yml

Validate Accessibility

Accessibility tests are run using Axe rules to ensure that the site meets accessibility standards.

The following jobs are defined for Validate acceptance stage: validate feature accessibility, validate dev accessibility, validate qa accessibility, validate prod accessibility.

Source: validate.accessibility.yml

Validate CSS

Visual regression tests are run using BackstopJS to compare pages on the site against reference images. These tests are run to ensure that no unintended visual changes have occurred on the site.

The following jobs are defined for Validate acceptance stage: validate feature CSS, validate dev CSS, validate qa CSS, validate prod CSS.

Source: validate.css.yml

Validate Core Requirements

Validate core requirements with drush.

The following jobs are defined for the validate core requirements jobs: validate feature core requirements, validate dev core requirements, validate qa core requirements, validate prod core requirements.

Source: validate.core-requirements.drupal.yml

Validate Drupal Deprecations

Check drupal deprecations.

The following jobs are defined for the validate core requirements jobs: test drupal deprecation dev, test drupal deprecation release.

Validate links in the given environment.

The following jobs are defined for the validate core requirements jobs: validate feature links, validate dev links, validate qa links, validate prod links.

Source: validate.links.yml

Validate Outdated Composer

Validate outdated composer packages.

The following jobs are defined for the validate core requirements jobs: test outdated composer dev, test outdated composer release.

Source: validate.outdated.composer.yml

Validate Outdated NPM

Validate outdated npm packages.

The following jobs are defined for the validate core requirements jobs: test outdated npm dev, test outdated npm release.

Source: validate.outdated.npm.yml

Validate PHP Compatability

Test PHP compatability.

The following jobs are defined for the validate core requirements jobs: test PHP compatability dev, test PHP compatability release.

Source: validate.phpcompatibility.drupal.yml

Validate URI

Validates that the site URI is set properly in the site's configuration.

The following jobs are defined for the validate URI jobs: validate feat URI, validate dev URI, validate qa URI, validate prod URI.

Source: validate.uri.drupal.yml

WARNING

Failures during the validation phase do not rollback the deployment.

TIP

Rolling back changes after this point requires a new deployment or manual intervention.

TIP

If you would like to run a pipeline with only the validate jobs, include [validate only] in your commit message.

TIP

If you would like to run a pipeline without the validate jobs, include [skip validate] in your commit message or run the pipeline with the SKIP_VALIDATE environment variable set to true.

Validate URI Pantheon

Validates that the site URI is set properly for pantheon in the site's configuration.

The following jobs are defined for the validate pantheon URI jobs: validate dev URI pantheon, validate qa URI pantheon, validate prod URI pantheon.

Source: validate.uri.drupal.pantheon.yml

Security

The security stage checks for security updates and outdated packages from Composer, NPM, and Drupal.

The following jobs are available in this stage:

Validate Security Drupal

This job checks for security vulnerabilities for drupal.

The following jobs are defined for the validate security drupal jobs: validate security drupal feature, validate security drupal dev, validate security drupal qa, validate security drupal prod.

Source: security.drupal.yml

Validate Security NPM

This job checks for security vulnerabilities for npm.

The following jobs are defined for the validate security drupal jobs: validate security npm feature, validate security npm dev, validate security npm qa, validate security npm prod.

Source: security.npm.yml

Validate Security Composer

This job checks for security vulnerabilities for composer.

The following jobs are defined for the validate security drupal jobs: validate security composer feature, validate security composer dev, validate security composer qa, validate security composer prod.

Source: security.composer.yml

Post Security

The post security stage is mainly for acting upon the results of the security stage. The following jobs are available:

Apply Updates

This job applies security and general updates for composer and npm.

Source: post_security.apply-updates.yml

Cleanup

The last step in the pipeline is to clean up temporary files and older backups, and perform any final reporting on the deployment.

The following jobs are available in this stage:

Clean Up

This job cleans up the given environment by removing site files and backing up the site into a single archive.

The following jobs are defined for the clean up jobs: clean up feature, clean up dev, clean up qa, clean up prod.

Source: cleanup.drupal.yml