feat: auto-deploy
This commit is contained in:
		@@ -135,4 +135,11 @@ class Application extends BaseModel
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
        return Activity::where('subject_id', $this->id)->where('properties->type_uuid', '=', $deployment_uuid)->first();
 | 
					        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?" />
 | 
					            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_git_lfs_allowed" label="Git LFS Allowed?" />
 | 
				
			||||||
        <x-inputs.input noDirty instantSave type="checkbox" id="is_debug" label="Debug" />
 | 
					        <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_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_previews" label="Previews?" />
 | 
				
			||||||
        <x-inputs.input disabled instantSave type="checkbox" id="is_custom_ssl" label="Is Custom SSL?" />
 | 
					        <x-inputs.input disabled instantSave type="checkbox" id="is_custom_ssl" label="Is Custom SSL?" />
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -95,6 +95,7 @@ Route::post('/source/github/events', function () {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        $applications = Application::where('project_id', $id)->where('git_branch', $branch)->get();
 | 
					        $applications = Application::where('project_id', $id)->where('git_branch', $branch)->get();
 | 
				
			||||||
        foreach ($applications as $application) {
 | 
					        foreach ($applications as $application) {
 | 
				
			||||||
 | 
					            if ($application->isDeployable()) {
 | 
				
			||||||
                GithubEventsApplications::create([
 | 
					                GithubEventsApplications::create([
 | 
				
			||||||
                    "delivery_guid" => $x_github_delivery,
 | 
					                    "delivery_guid" => $x_github_delivery,
 | 
				
			||||||
                    "application_id" => $application->id
 | 
					                    "application_id" => $application->id
 | 
				
			||||||
@@ -106,6 +107,7 @@ Route::post('/source/github/events', function () {
 | 
				
			|||||||
                    force_rebuild: false,
 | 
					                    force_rebuild: false,
 | 
				
			||||||
                ));
 | 
					                ));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    } catch (\Exception $e) {
 | 
					    } catch (\Exception $e) {
 | 
				
			||||||
        return generalErrorHandler($e);
 | 
					        return generalErrorHandler($e);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user