1
0
Fork 0
mirror of synced 2024-06-14 00:34:51 +12:00

feat: fix retry build

This commit is contained in:
Christy Jacob 2022-02-17 00:06:22 +04:00
parent 45dd25b5b6
commit 75f4061698
3 changed files with 8 additions and 12 deletions

View file

@ -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
]);

View file

@ -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>

View file

@ -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;