Skip to content

Comments

Envoy#27

Merged
AllanKoder merged 8 commits intomasterfrom
envoy
Aug 24, 2025
Merged

Envoy#27
AllanKoder merged 8 commits intomasterfrom
envoy

Conversation

@AllanKoder
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings August 22, 2025 03:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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 }}

Copilot uses AI. Check for mistakes.

@task('perform-migration', ['on' => 'server'])
set -e
cd /var/www/ComputerScienceResources.com
Copy link

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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 }}

Copilot uses AI. Check for mistakes.

@task('perform-migration', ['on' => 'server'])
set -e
cd /var/www/ComputerScienceResources.com
Copy link

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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 }}

Copilot uses AI. Check for mistakes.

@task('perform-migration', ['on' => 'server'])
set -e
cd /var/www/ComputerScienceResources.com
Copy link

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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 }}

Copilot uses AI. Check for mistakes.

@task('perform-migration', ['on' => 'server'])
set -e
cd /var/www/ComputerScienceResources.com
Copy link

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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 }}

Copilot uses AI. Check for mistakes.
@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
Copy link

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
@task('update-code', ['on' => 'server'])
set -e
cd /var/www/ComputerScienceResources.com
git pull origin master
Copy link

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
git pull origin master
git pull origin {{ $branch }}

Copilot uses AI. Check for mistakes.
AllanKoder and others added 6 commits August 21, 2025 20:27
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@AllanKoder AllanKoder merged commit ce84a03 into master Aug 24, 2025
3 checks passed
@AllanKoder AllanKoder deleted the envoy branch August 24, 2025 01:16
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