Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Laravel Application Installation Script Service #334

Merged

Conversation

sweep-ai[bot]
Copy link
Contributor

@sweep-ai sweep-ai bot commented Dec 25, 2024

This pull request was created by Sweep to resolve the following request by @curtisdelicata:

write a custom solution to pre configuring scripts to be installed on any supported web hosting server, including cPanel, Plesk, DirectAdmin or VirtualMin. the script is primarily required to set up a Laravel application, ready with migrated and seeded database connected, artisan key generate, storage link setup, composer install ran as well as npm install and npm run build. the code should be checked out by git into a folder inside the users /home directory and the public_html or subdirectory should be a symbolic link to the public folder inside the laravel git cloned directory to be very secure.

Continue chatting at https://sweep-chat-demo.vercel.app/c/16cfa1f2-102d-451f-b871-a4008ed093d7.

Purpose

Implement a robust, flexible automated installation service for deploying Laravel applications across different control panel environments, enabling streamlined and standardized web application deployment.

Description

This pull request introduces a comprehensive installation script generation and execution system that supports multiple control panel platforms. The implementation includes:

  • An InstallationScriptService that dynamically generates bash installation scripts
  • Support for multiple control panels (cPanel, Plesk, DirectAdmin, Virtualmin)
  • Automated repository cloning, dependency installation, and environment configuration
  • Secure database and application setup
  • Comprehensive error handling and logging

The service handles critical deployment tasks such as:

  • Creating installation directories
  • Cloning Git repositories
  • Installing Composer and npm dependencies
  • Configuring Laravel environment
  • Running migrations and seeders
  • Setting appropriate file permissions
  • Creating symbolic links

An InstallationController provides a secure API endpoint for triggering these installations with proper request validation.

Summary

  • Added new InstallationScriptService in app/Services/InstallationScriptService.php
  • Created InstallationController in app/Http/Controllers/InstallationController.php
  • Updated routes/api.php to include new installation endpoint
  • Supports installation across cpanel, plesk, directadmin, and virtualmin
  • Implements comprehensive error handling and logging
  • Provides a flexible, secure deployment mechanism for Laravel applications

@curtisdelicata curtisdelicata merged commit 955cc59 into main Dec 25, 2024
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant