feat: fix retry build
This commit is contained in:
parent
45dd25b5b6
commit
75f4061698
|
@ -1038,7 +1038,8 @@ App::post('/v1/functions/:functionId/deployments/:deploymentId/builds/:buildId')
|
|||
// Enqueue a message to start the build
|
||||
Resque::enqueue(Event::BUILDS_QUEUE_NAME, Event::BUILDS_CLASS_NAME, [
|
||||
'projectId' => $project->getId(),
|
||||
'buildId' => $buildId,
|
||||
'functionId' => $function->getId(),
|
||||
'deploymentId' => $deploymentId,
|
||||
'type' => BUILD_TYPE_RETRY
|
||||
]);
|
||||
|
||||
|
|
|
@ -135,6 +135,8 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled', true);
|
|||
data-failure-param-alert-text="Failed to retry build"
|
||||
data-failure-param-alert-classname="error">
|
||||
<input type="hidden" name="buildId" data-ls-bind="{{deployment.buildId}}">
|
||||
<input type="hidden" name="functionId" data-ls-bind="{{router.params.id}}">
|
||||
<input type="hidden" name="deploymentId" data-ls-bind="{{deployment.$id}}">
|
||||
<button>Retry Build</button>
|
||||
</form>
|
||||
|
||||
|
|
|
@ -39,23 +39,16 @@ class BuildsV1 extends Worker
|
|||
{
|
||||
$type = $this->args['type'] ?? '';
|
||||
$projectId = $this->args['projectId'] ?? '';
|
||||
|
||||
$functionId = $this->args['functionId'] ?? '';
|
||||
$deploymentId = $this->args['deploymentId'] ?? '';
|
||||
|
||||
switch ($type) {
|
||||
case BUILD_TYPE_DEPLOYMENT:
|
||||
$functionId = $this->args['functionId'] ?? '';
|
||||
$deploymentId = $this->args['deploymentId'] ?? '';
|
||||
case BUILD_TYPE_RETRY:
|
||||
Console::info("Creating build for deployment: $deploymentId");
|
||||
$this->buildDeployment($projectId, $functionId, $deploymentId);
|
||||
break;
|
||||
|
||||
// case BUILD_TYPE_RETRY:
|
||||
// $buildId = $this->args['buildId'] ?? '';
|
||||
// $functionId = $this->args['functionId'] ?? '';
|
||||
// $deploymentId = $this->args['deploymentId'] ?? '';
|
||||
// Console::info("Retrying build for id: $buildId");
|
||||
// $this->createBuild($projectId, $functionId, $deploymentId, $buildId);
|
||||
// break;
|
||||
|
||||
default:
|
||||
throw new \Exception('Invalid build type');
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue