From 9923aab4fe3c253951914f88c1a3eeee4e8c3644 Mon Sep 17 00:00:00 2001 From: Henrik Lauritsen Date: Tue, 18 Aug 2026 15:38:41 +0200 Subject: [PATCH 1/2] Add zero downtime deployment info in configuring-update-scripts.md --- content/collections/tips/configuring-update-scripts.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/content/collections/tips/configuring-update-scripts.md b/content/collections/tips/configuring-update-scripts.md index bd71e746c..4d38f6b37 100644 --- a/content/collections/tips/configuring-update-scripts.md +++ b/content/collections/tips/configuring-update-scripts.md @@ -36,3 +36,12 @@ php please updates:run 3.0 :::tip This is a one-time thing and will be automatically triggered by future Statamic updates. ::: + +### Running update scripts when doing zero downtime deployments + +Since zero downtime deployments typically use a multiple-release directory structure, where each new deployment is a fresh installation of the application, update scripts can be missed. +To ensure update scripts are run, add a step to your deployment pipeline that makes a backup of the `composer.lock` file. +``` shell +# Backup composer lock file to ensure update scripts are run +cp composer.lock storage/statamic/updater/composer.lock.bak +``` From 66e7c0dfcd2c4f57d8a0a0188e082f2345cbcdb8 Mon Sep 17 00:00:00 2001 From: Henrik Lauritsen Date: Tue, 18 Aug 2026 15:41:33 +0200 Subject: [PATCH 2/2] Add update scripts info in zero-downtime-deployments.md --- content/collections/tips/zero-downtime-deployments.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/content/collections/tips/zero-downtime-deployments.md b/content/collections/tips/zero-downtime-deployments.md index d909468e9..9ada47b4e 100644 --- a/content/collections/tips/zero-downtime-deployments.md +++ b/content/collections/tips/zero-downtime-deployments.md @@ -34,6 +34,15 @@ Every deployment has its own timestamped release directory, with a fresh clone o After a successful deployment, the `current` folder is then symlinked to the latest release. This symlink swap is the secret sauce for zero downtime. +### Ensure update scripts are run + +Since each new deployment is a fresh installation of the application, update scripts can be missed. +To ensure update scripts are run, add a step to your deployment pipeline that makes a backup of the `composer.lock` file. +``` shell +# Backup composer lock file to ensure update scripts are run +cp composer.lock storage/statamic/updater/composer.lock.bak +``` + ## Cache storage Statamic's content management heavily relies on caching, and sometimes it's necessary for the [Stache](/stache) to store absolute file paths in your app's cache. This can lead to deployment errors when users are hitting your frontend, since each release [exists in a separate timestamped folder](#understanding-the-folder-structure).