From 975771278e910be5ad0e2e4019b2509bc43b9356 Mon Sep 17 00:00:00 2001 From: Adrien Peyre Date: Fri, 20 Feb 2026 14:21:57 +0100 Subject: [PATCH] Fix local_archive strategy to use git root directory for archive --- recipe/deploy/update_code.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/recipe/deploy/update_code.php b/recipe/deploy/update_code.php index f9e2ea5ce..57d268691 100644 --- a/recipe/deploy/update_code.php +++ b/recipe/deploy/update_code.php @@ -81,11 +81,12 @@ } if ($strategy === 'local_archive') { - runLocally("$git archive $targetWithDir -o archive.tar"); - upload('archive.tar', '{{release_path}}/archive.tar'); + $gitRoot = runLocally("$git rev-parse --show-toplevel"); + runLocally("$git -C " . escapeshellarg($gitRoot) . " archive $targetWithDir -o archive.tar"); + upload("$gitRoot/archive.tar", '{{release_path}}/archive.tar'); run("tar -xf {{release_path}}/archive.tar -C {{release_path}}"); run("rm {{release_path}}/archive.tar"); - unlink('archive.tar'); + unlink("$gitRoot/archive.tar"); $rev = escapeshellarg(runLocally("git rev-list $target -1")); } else {