fix: issue with auto deploy flag
This commit is contained in:
parent
6752300cc1
commit
33c58bfc65
|
@ -519,7 +519,9 @@ App::post('/v1/functions/:functionId/deployments')
|
|||
throw new Exception('Failed moving file', 500);
|
||||
}
|
||||
|
||||
if ((bool) $activate) {
|
||||
$activate = (bool) filter_var($activate, FILTER_VALIDATE_BOOLEAN);
|
||||
|
||||
if ($activate) {
|
||||
// Remove deploy for all other deployments.
|
||||
$deployments = $dbForProject->find('deployments', [
|
||||
new Query('activate', Query::TYPE_EQUAL, [true]),
|
||||
|
@ -545,7 +547,7 @@ App::post('/v1/functions/:functionId/deployments')
|
|||
'path' => $path,
|
||||
'size' => $size,
|
||||
'search' => implode(' ', [$deploymentId, $entrypoint]),
|
||||
'activate' => ((bool) $activate === true),
|
||||
'activate' => $activate,
|
||||
]));
|
||||
|
||||
// Enqueue a message to start the build
|
||||
|
|
|
@ -203,6 +203,7 @@ App::post('/v1/runtimes')
|
|||
'-f',
|
||||
'/dev/null'
|
||||
];
|
||||
|
||||
$containerId = $orchestration->run(
|
||||
image: $baseImage,
|
||||
name: $runtimeId,
|
||||
|
|
|
@ -140,8 +140,14 @@ class BuildsV1 extends Worker
|
|||
|
||||
Console::success("Build id: $buildId created");
|
||||
|
||||
|
||||
var_dump("Going to set auto deploy");
|
||||
var_dump($deployment);
|
||||
var_dump($deployment->getAttribute('activate'));
|
||||
var_dump(gettype($deployment->getAttribute('activate')));
|
||||
/** Set auto deploy */
|
||||
if ($deployment->getAttribute('activate') === true) {
|
||||
var_dump("Setting auto deploy");
|
||||
$function->setAttribute('deployment', $deployment->getId());
|
||||
$function = $dbForProject->updateDocument('functions', $functionId, $function);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue