From bf5855d101ebaecdfdb2d2a7383b5d59989e2325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Sun, 28 May 2023 10:02:23 +0200 Subject: [PATCH] Fix bugs after merge --- app/console | 2 +- app/controllers/api/functions.php | 6 +++++- app/workers/builds.php | 4 +--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/console b/app/console index dd6555abd4..2f4e16038d 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit dd6555abd460b55be996d9d8e10c95801e8bf662 +Subproject commit 2f4e16038db4968371ef3a5b1189294d3dc60788 diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 11c422393a..db009eb9e7 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -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, diff --git a/app/workers/builds.php b/app/workers/builds.php index 7cb4bbcbbb..e5f4165205 100644 --- a/app/workers/builds.php +++ b/app/workers/builds.php @@ -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();