mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Merge pull request #10571 from appwrite/fix-builds-worker-output-directory
fix(builds-worker): Use outputDirectory attribute from deployment
This commit is contained in:
commit
e244cb2f02
1 changed files with 4 additions and 3 deletions
|
|
@ -686,6 +686,7 @@ class Builds extends Action
|
||||||
if ($version === 'v2') {
|
if ($version === 'v2') {
|
||||||
$command = 'tar -zxf /tmp/code.tar.gz -C /usr/code && cd /usr/local/src/ && ./build.sh';
|
$command = 'tar -zxf /tmp/code.tar.gz -C /usr/code && cd /usr/local/src/ && ./build.sh';
|
||||||
} else {
|
} else {
|
||||||
|
$outputDirectory = $deployment->getAttribute('outputDirectory') ?? $resource->getAttribute('outputDirectory');
|
||||||
if ($resource->getCollection() === 'sites') {
|
if ($resource->getCollection() === 'sites') {
|
||||||
$listFilesCommand = '';
|
$listFilesCommand = '';
|
||||||
|
|
||||||
|
|
@ -693,8 +694,8 @@ class Builds extends Action
|
||||||
$listFilesCommand .= 'echo "{APPWRITE_DETECTION_SEPARATOR_START}" && cd /usr/local/build';
|
$listFilesCommand .= 'echo "{APPWRITE_DETECTION_SEPARATOR_START}" && cd /usr/local/build';
|
||||||
|
|
||||||
// Enter output directory, if set
|
// Enter output directory, if set
|
||||||
if (!empty($resource->getAttribute('outputDirectory', ''))) {
|
if (!empty($outputDirectory)) {
|
||||||
$listFilesCommand .= ' && cd ' . \escapeshellarg($resource->getAttribute('outputDirectory', ''));
|
$listFilesCommand .= ' && cd ' . \escapeshellarg($outputDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print files, and end separation
|
// Print files, and end separation
|
||||||
|
|
@ -725,7 +726,7 @@ class Builds extends Action
|
||||||
destination: APP_STORAGE_BUILDS . "/app-{$project->getId()}",
|
destination: APP_STORAGE_BUILDS . "/app-{$project->getId()}",
|
||||||
variables: $vars,
|
variables: $vars,
|
||||||
command: $command,
|
command: $command,
|
||||||
outputDirectory: $resource->getAttribute('outputDirectory', '')
|
outputDirectory: $outputDirectory ?? ''
|
||||||
);
|
);
|
||||||
|
|
||||||
Console::log('createRuntime finished');
|
Console::log('createRuntime finished');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue