Skip to content

Commit c78d859

Browse files
authored
Fix local_archive strategy to use git root directory for archive (#4168)
1 parent 6c6e886 commit c78d859

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

recipe/deploy/update_code.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,12 @@
8181
}
8282

8383
if ($strategy === 'local_archive') {
84-
runLocally("$git archive $targetWithDir -o archive.tar");
85-
upload('archive.tar', '{{release_path}}/archive.tar');
84+
$gitRoot = runLocally("$git rev-parse --show-toplevel");
85+
runLocally("$git -C " . escapeshellarg($gitRoot) . " archive $targetWithDir -o archive.tar");
86+
upload("$gitRoot/archive.tar", '{{release_path}}/archive.tar');
8687
run("tar -xf {{release_path}}/archive.tar -C {{release_path}}");
8788
run("rm {{release_path}}/archive.tar");
88-
unlink('archive.tar');
89+
unlink("$gitRoot/archive.tar");
8990

9091
$rev = escapeshellarg(runLocally("git rev-list $target -1"));
9192
} else {

0 commit comments

Comments
 (0)