feat: auto-deploy
This commit is contained in:
parent
c659683d92
commit
c41bc8dac2
@ -135,4 +135,11 @@ public function get_deployment(string $deployment_uuid)
|
||||
{
|
||||
return Activity::where('subject_id', $this->id)->where('properties->type_uuid', '=', $deployment_uuid)->first();
|
||||
}
|
||||
public function isDeployable(): bool
|
||||
{
|
||||
if ($this->settings->is_auto_deploy) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,7 @@
|
||||
label="Git Submodules Allowed?" />
|
||||
<x-inputs.input noDirty instantSave type="checkbox" id="is_git_lfs_allowed" label="Git LFS Allowed?" />
|
||||
<x-inputs.input noDirty instantSave type="checkbox" id="is_debug" label="Debug" />
|
||||
<x-inputs.input disabled instantSave type="checkbox" id="is_auto_deploy" label="Auto Deploy?" />
|
||||
<x-inputs.input noDirty instantSave type="checkbox" id="is_auto_deploy" label="Auto Deploy?" />
|
||||
<x-inputs.input disabled instantSave type="checkbox" id="is_dual_cert" label="Dual Certs?" />
|
||||
<x-inputs.input disabled instantSave type="checkbox" id="is_previews" label="Previews?" />
|
||||
<x-inputs.input disabled instantSave type="checkbox" id="is_custom_ssl" label="Is Custom SSL?" />
|
||||
|
@ -95,16 +95,18 @@
|
||||
}
|
||||
$applications = Application::where('project_id', $id)->where('git_branch', $branch)->get();
|
||||
foreach ($applications as $application) {
|
||||
GithubEventsApplications::create([
|
||||
"delivery_guid" => $x_github_delivery,
|
||||
"application_id" => $application->id
|
||||
]);
|
||||
$deployment_uuid = new Cuid2(7);
|
||||
dispatch(new DeployApplicationJob(
|
||||
deployment_uuid: $deployment_uuid,
|
||||
application_uuid: $application->uuid,
|
||||
force_rebuild: false,
|
||||
));
|
||||
if ($application->isDeployable()) {
|
||||
GithubEventsApplications::create([
|
||||
"delivery_guid" => $x_github_delivery,
|
||||
"application_id" => $application->id
|
||||
]);
|
||||
$deployment_uuid = new Cuid2(7);
|
||||
dispatch(new DeployApplicationJob(
|
||||
deployment_uuid: $deployment_uuid,
|
||||
application_uuid: $application->uuid,
|
||||
force_rebuild: false,
|
||||
));
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return generalErrorHandler($e);
|
||||
|
Loading…
Reference in New Issue
Block a user