From 4a9777c56a684a202537c49edb705e02e8e3836d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Wed, 21 Oct 2026 19:10:03 +0200 Subject: [PATCH] fix: deploy from the host, build inside DDEV dep runs on the host with its SSH keys; the build (composer install, npm ci, npm run build) runs through ddev exec, so Composer and Node are the project's versions. Inside DDEV the commands run directly. Co-Authored-By: Claude Opus 5.5 --- deploy.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/deploy.php b/deploy.php index 23d08da..c6ea574 100644 --- a/deploy.php +++ b/deploy.php @@ -2,7 +2,8 @@ namespace Deployer; -// Run inside DDEV after "ddev auth ssh": ddev exec vendor/bin/dep deploy +// Run on the host (Deployer 8, PHP >= 8.3): dep deploy prod. The SSH keys stay on the host; the +// build runs inside DDEV, so Composer and Node are the project's versions. // Prerequisites on the host: see .ddev/plans/TYPO3-13-GO-LIVE.md (PHP 8.5.12, database, secrets.php) require 'recipe/typo3.php'; @@ -84,10 +85,15 @@ host('prod') desc('Build the release locally: committed state, production dependencies, theme assets'); task('build', function () { + // Inside DDEV directly, on the host through "ddev exec" (paths relative to the project root) + $inDdev = getenv('IS_DDEV_PROJECT') === 'true'; + $exec = fn (string $command) => runLocally($inDdev + ? $command + : 'ddev exec bash -c ' . escapeshellarg($command)); runLocally('rm -rf {{build_dir}} && mkdir -p {{build_dir}}'); runLocally('git archive HEAD | tar -x -C {{build_dir}}'); - runLocally('cd {{build_dir}} && composer install --no-dev --prefer-dist --no-progress --no-interaction --optimize-autoloader'); - runLocally('cd {{build_dir}} && npm ci --no-audit --no-fund && npm run build'); + $exec('cd var/deploy-build && composer install --no-dev --prefer-dist --no-progress --no-interaction --optimize-autoloader'); + $exec('cd var/deploy-build && npm ci --no-audit --no-fund && npm run build'); })->once(); desc('Read-only checks of the host before the first deploy (see .ddev/plans/TYPO3-13-GO-LIVE.md)');