Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds Laravel Envoy deployment automation to the project. Laravel Envoy is a task runner that provides a clean syntax for defining common tasks run on remote servers.
- Added Laravel Envoy package as a development dependency
- Created an Envoy.blade.php file with a complete deployment pipeline including frontend building, database backup, code updates, and server management
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| composer.json | Added laravel/envoy package dependency for deployment automation |
| Envoy.blade.php | Created deployment script with tasks for building frontend, updating code, managing database, and server operations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| @task('perform-migration', ['on' => 'server']) | ||
| set -e | ||
| cd /var/www/ComputerScienceResources.com |
There was a problem hiding this comment.
The deployment path '/var/www/ComputerScienceResources.com' is duplicated across multiple tasks. Consider defining this as a variable at the top of the file to improve maintainability and reduce the risk of inconsistencies.
| cd /var/www/ComputerScienceResources.com | |
| cd {{ $deploy_path }} | |
| php artisan down | |
| @endtask | |
| @task('up', ['on' => 'server']) | |
| set -e | |
| cd {{ $deploy_path }} | |
| php artisan up | |
| @endtask | |
| @task('backup-database', ['on' => 'server']) | |
| set -e | |
| cd {{ $deploy_path }} | |
| php artisan backup:run --only-db | |
| @endtask | |
| @task('update-code', ['on' => 'server']) | |
| set -e | |
| cd {{ $deploy_path }} | |
| git pull origin master | |
| @endtask | |
| @task('install-dependencies', ['on' => 'server']) | |
| set -e | |
| cd {{ $deploy_path }} | |
| composer install --no-dev --optimize-autoloader | |
| @endtask | |
| @task('perform-migration', ['on' => 'server']) | |
| set -e | |
| cd {{ $deploy_path }} |
|
|
||
| @task('perform-migration', ['on' => 'server']) | ||
| set -e | ||
| cd /var/www/ComputerScienceResources.com |
There was a problem hiding this comment.
The deployment path '/var/www/ComputerScienceResources.com' is duplicated across multiple tasks. Consider defining this as a variable at the top of the file to improve maintainability and reduce the risk of inconsistencies.
| cd /var/www/ComputerScienceResources.com | |
| cd {{ $deploy_path }} | |
| php artisan down | |
| @endtask | |
| @task('up', ['on' => 'server']) | |
| set -e | |
| cd {{ $deploy_path }} | |
| php artisan up | |
| @endtask | |
| @task('backup-database', ['on' => 'server']) | |
| set -e | |
| cd {{ $deploy_path }} | |
| php artisan backup:run --only-db | |
| @endtask | |
| @task('update-code', ['on' => 'server']) | |
| set -e | |
| cd {{ $deploy_path }} | |
| git pull origin master | |
| @endtask | |
| @task('install-dependencies', ['on' => 'server']) | |
| set -e | |
| cd {{ $deploy_path }} | |
| composer install --no-dev --optimize-autoloader | |
| @endtask | |
| @task('perform-migration', ['on' => 'server']) | |
| set -e | |
| cd {{ $deploy_path }} |
|
|
||
| @task('perform-migration', ['on' => 'server']) | ||
| set -e | ||
| cd /var/www/ComputerScienceResources.com |
There was a problem hiding this comment.
The deployment path '/var/www/ComputerScienceResources.com' is duplicated across multiple tasks. Consider defining this as a variable at the top of the file to improve maintainability and reduce the risk of inconsistencies.
| cd /var/www/ComputerScienceResources.com | |
| cd {{ $DEPLOY_PATH }} | |
| php artisan down | |
| @endtask | |
| @task('up', ['on' => 'server']) | |
| set -e | |
| cd {{ $DEPLOY_PATH }} | |
| php artisan up | |
| @endtask | |
| @task('backup-database', ['on' => 'server']) | |
| set -e | |
| cd {{ $DEPLOY_PATH }} | |
| php artisan backup:run --only-db | |
| @endtask | |
| @task('update-code', ['on' => 'server']) | |
| set -e | |
| cd {{ $DEPLOY_PATH }} | |
| git pull origin master | |
| @endtask | |
| @task('install-dependencies', ['on' => 'server']) | |
| set -e | |
| cd {{ $DEPLOY_PATH }} | |
| composer install --no-dev --optimize-autoloader | |
| @endtask | |
| @task('perform-migration', ['on' => 'server']) | |
| set -e | |
| cd {{ $DEPLOY_PATH }} |
|
|
||
| @task('perform-migration', ['on' => 'server']) | ||
| set -e | ||
| cd /var/www/ComputerScienceResources.com |
There was a problem hiding this comment.
The deployment path '/var/www/ComputerScienceResources.com' is duplicated across multiple tasks. Consider defining this as a variable at the top of the file to improve maintainability and reduce the risk of inconsistencies.
| cd /var/www/ComputerScienceResources.com | |
| cd {{ $deploy_path }} | |
| php artisan down | |
| @endtask | |
| @task('up', ['on' => 'server']) | |
| set -e | |
| cd {{ $deploy_path }} | |
| php artisan up | |
| @endtask | |
| @task('backup-database', ['on' => 'server']) | |
| set -e | |
| cd {{ $deploy_path }} | |
| php artisan backup:run --only-db | |
| @endtask | |
| @task('update-code', ['on' => 'server']) | |
| set -e | |
| cd {{ $deploy_path }} | |
| git pull origin master | |
| @endtask | |
| @task('install-dependencies', ['on' => 'server']) | |
| set -e | |
| cd {{ $deploy_path }} | |
| composer install --no-dev --optimize-autoloader | |
| @endtask | |
| @task('perform-migration', ['on' => 'server']) | |
| set -e | |
| cd {{ $deploy_path }} |
|
|
||
| @task('perform-migration', ['on' => 'server']) | ||
| set -e | ||
| cd /var/www/ComputerScienceResources.com |
There was a problem hiding this comment.
The deployment path '/var/www/ComputerScienceResources.com' is duplicated across multiple tasks. Consider defining this as a variable at the top of the file to improve maintainability and reduce the risk of inconsistencies.
| cd /var/www/ComputerScienceResources.com | |
| cd {{ $DEPLOY_PATH }} | |
| php artisan down | |
| @endtask | |
| @task('up', ['on' => 'server']) | |
| set -e | |
| cd {{ $DEPLOY_PATH }} | |
| php artisan up | |
| @endtask | |
| @task('backup-database', ['on' => 'server']) | |
| set -e | |
| cd {{ $DEPLOY_PATH }} | |
| php artisan backup:run --only-db | |
| @endtask | |
| @task('update-code', ['on' => 'server']) | |
| set -e | |
| cd {{ $DEPLOY_PATH }} | |
| git pull origin master | |
| @endtask | |
| @task('install-dependencies', ['on' => 'server']) | |
| set -e | |
| cd {{ $DEPLOY_PATH }} | |
| composer install --no-dev --optimize-autoloader | |
| @endtask | |
| @task('perform-migration', ['on' => 'server']) | |
| set -e | |
| cd {{ $DEPLOY_PATH }} |
| @task('deploy-frontend', ['on' => 'local']) | ||
| set -e | ||
| echo "Copying compiled assets to server..." | ||
| scp -r {{ __DIR__ }}/public/build root@143.198.129.111:/var/www/ComputerScienceResources.com/public |
There was a problem hiding this comment.
Using SCP with hard-coded credentials exposes sensitive server information. Consider using SSH keys with a configured host alias or environment variables for server details.
| scp -r {{ __DIR__ }}/public/build root@143.198.129.111:/var/www/ComputerScienceResources.com/public | |
| scp -r {{ __DIR__ }}/public/build production-server:/var/www/ComputerScienceResources.com/public |
| @task('update-code', ['on' => 'server']) | ||
| set -e | ||
| cd /var/www/ComputerScienceResources.com | ||
| git pull origin master |
There was a problem hiding this comment.
Using 'master' branch name may be outdated. Consider using 'main' if that's the default branch, or make the branch name configurable to avoid assumptions about repository structure.
| git pull origin master | |
| git pull origin {{ $branch }} |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.