Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

Update process

Karl Hepworth edited this page May 7, 2020 · 3 revisions

This document details the update process used by Lagoon when the scaffold is applied to a GovCMS8 PaaS project.

It's important to note this process is not the same as a SaaS project, where the deployments are completely managed and the changes have not yet made it into the SaaS scaffold.

Lagoon uses a series of commands which can be specified in a ./lagoon.yml file. These commands are executed either before a rollout is scheduled or after a rollout is complete. The following are specified by the As described in GovCMS8 PaaS scaffold .lagoon.yml:

Pre-deployment tasks

  1. Pre-rollout database updates

    This will perform a "drush updb" on an environment when the environment has the GOVCMS_DEPLOY_PRE_UPDB variable defined.

    In some use cases, database updates need to be performed early in the deploy process, even before the site has been bootstrapped (for example with drush status). This provides the deploy agent the ability to perform updates early in the automated flow.

  2. Snapshot the database and store

    This will perform a database backup. It is intended to be run as a pre-rollout task or early in the execution flow.

  3. Snapshot the config and store

    This will perform a configuration backup. It is intended to be run as a pre-rollout task or early in the execution flow.

Post-deployment tasks:

  1. Prepare the site for deployment

    This will perform a configuration backup. It is intended to be run as a pre-rollout task or early in the execution flow.

  2. Synchronise the database

    This will pull a database from the production environment.

  3. Perform database updates

    GovCMS update database.

  4. Perform config import

    GovCMS configuration import.

  5. Perform cache rebuild

    Allow a cache-rebuild to be toggled at deploy time.

  6. Ensure GovCMS/Lagoon modules are enabled

    The GovCMS platform provides some modules to assist with running on the platform, this will ensure they're enabled every deploy.

  7. Preserve the last successful backup

    If a backup has been taken during a previous deployment we move that to a different location so that we have a potential restore point if something goes wrong.

Customisation

You can also adopt the functionality in this scaffold by ensuring your projects scaffold is compatible with the following composer snippet. It will add the workflow integrations from scaffold-tooling and will allow tasks to be added as required. It is recommended to use the .lagoon.yml as part of this repository but this will allow the functionality while detaching from this project directly.

    "require": {
        "govcms/govcms": "~1",
        "govcms/scaffold-tooling": "~2",
        "govcms/custom": "*",
        "symfony/event-dispatcher": "4.3.11 as 3.4.35"
    },

The tasks detailed above are there in this scaffold by default and they will be suitable to most users. If you want more control over the deployment process you're able to reorder/change the tasks in .lagoon.yml. This will assume greater control and responsibility over the project, so any support related to this may deviate from what could normally be expected.

If you wish to stay up to date with the scaffold changes, it is suggested to use composers native patch workflow. And you can even fork this project for integration if you would like to add/remove/modify your own scripts. You will assume greater responsibility here and support cannot be guaranteed if you are writing custom scripts for workflow in .lagoon.yml.

Clone this wiki locally