Skip to main content

Lagoon

Lagoon is an open-source container-based hosting platform that provides automated deployments for Drupal applications using Docker and Kubernetes.

For general Lagoon documentation, refer to the Lagoon Documentation.

This page covers how the site behaves once it runs on Lagoon. For how code gets there from CI, see Lagoon deployment.

Integration

Vortex provides the following integration with Lagoon:

Tasks

With Vortex, you can:

  • Fetch a database from a Lagoon environment for local development or CI
  • Trigger deployments to Lagoon environments - see Lagoon deployment
  • Run custom commands on Lagoon environments

When running these tasks, your .env and .env.local files are used as the source for the project name and SSH configuration.

Deployment automation

When code is deployed, Vortex automatically:

  1. Provisions the site - Runs database updates, imports configuration, clears caches
  2. Sends notifications - Notifies configured channels about the deployment

This is implemented using post-rollout tasks defined in the .lagoon.yml configuration file, which also defines per-environment cron jobs and routes.

Environment detection

Vortex automatically detects when running on Lagoon and loads appropriate settings from web/sites/default/includes/providers/settings.lagoon.php. This includes Lagoon-specific configurations for caching, file paths, and environment variables provided by the platform.

Onboarding

Lagoon onboarding is part of the project setup flow. See Set up hosting in the Installation guide and select Lagoon.

Routine operations

Fetch database

Fetch a database backup from your Lagoon environment for local development or CI builds:

ahoy fetch-db

Run a custom task

Run an arbitrary command in a Lagoon environment through the platform-agnostic task runner, which drives the Lagoon CLI:

VORTEX_PLATFORM=lagoon \
VORTEX_TASK_CUSTOM_LAGOON_BRANCH=develop \
VORTEX_TASK_CUSTOM_LAGOON_COMMAND="drush cron" \
./vendor/bin/vortex-task custom

The task reads the project name and SSH configuration from your .env and .env.local files; VORTEX_TASK_CUSTOM_LAGOON_BRANCH selects the environment and VORTEX_TASK_CUSTOM_LAGOON_COMMAND is the command to run there.