Fix bugs after merge

This commit is contained in:
Matej Bačo
2023-05-28 10:02:23 +02:00
parent 507b2d978a
commit bf5855d101
3 changed files with 7 additions and 5 deletions
+5 -1
View File
@@ -574,7 +574,7 @@ App::put('/v1/functions/:functionId')
// activate the deployment for first run of a VCS repo
if ($needToDeploy) {
$deploymentId = ID::unique();
$entrypoint = 'index.js'; //TODO: Read from function settings
$entrypoint = $function->getAttribute('entrypoint', '');
$deployment = $dbForProject->getDocument('deployments', $deploymentId);
//Add document in VCS repos collection
@@ -608,6 +608,8 @@ App::put('/v1/functions/:functionId')
'resourceId' => $function->getId(),
'resourceType' => 'functions',
'entrypoint' => $entrypoint,
'buildCommand' => $buildCommand,
'installCommand' => $installCommand,
'type' => 'vcs',
'vcsInstallationId' => $installation->getId(),
'vcsInstallationInternalId' => $installation->getInternalId(),
@@ -960,6 +962,8 @@ App::post('/v1/functions/:functionId/deployments')
'resourceId' => $function->getId(),
'resourceType' => 'functions',
'entrypoint' => $entrypoint,
'buildCommand' => $buildCommand,
'installCommand' => $installCommand,
'path' => $path,
'size' => $fileSize,
'chunksTotal' => $chunks,
+1 -3
View File
@@ -274,8 +274,6 @@ class BuildsV1 extends Worker
$command = \str_replace('"', '\\"', $command);
\var_dump($path);
$response = $this->executor->createRuntime(
projectId: $project->getId(),
deploymentId: $deployment->getId(),
@@ -289,7 +287,7 @@ class BuildsV1 extends Worker
commands: [
'sh', '-c',
'tar -zxf /tmp/code.tar.gz -C /mnt/code && helpers/build.sh "' . $command . '"'
]
],
);
$endTime = DateTime::now();