From 9115aa392d7b8f0d38105965d36a3cd504e41003 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 17 Feb 2022 00:38:58 +0400 Subject: [PATCH] feat: create build when activating a deployment --- app/controllers/api/functions.php | 8 ++++++++ app/views/console/functions/function.phtml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 1780c572e2..bb3e3c9ad3 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -406,6 +406,14 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId') ]); // Async task rescheduale } + // Enqueue a message to start the build + Resque::enqueue(Event::BUILDS_QUEUE_NAME, Event::BUILDS_CLASS_NAME, [ + 'projectId' => $project->getId(), + 'functionId' => $function->getId(), + 'deploymentId' => $deploymentId, + 'type' => BUILD_TYPE_DEPLOYMENT + ]); + $response->dynamic($function, Response::MODEL_FUNCTION); }); diff --git a/app/views/console/functions/function.phtml b/app/views/console/functions/function.phtml index c51df36323..c4ef2a9374 100644 --- a/app/views/console/functions/function.phtml +++ b/app/views/console/functions/function.phtml @@ -117,7 +117,7 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled', true); data-failure="alert" data-failure-param-alert-text="Failed to update deployment" data-failure-param-alert-classname="error"> - +