stekel / laravel-deploy
Helpful command for deploying a given repository to a remote machine.
v3.1.9
2023-03-08 00:38 UTC
Requires
- php: >7.1
- illuminate/console: >5.7
- illuminate/support: >5.7
- phpseclib/phpseclib: ^3.0
Requires (Dev)
- mockery/mockery: ^1.0@dev
- phpunit/phpunit: ^8.0
README
Helpful command for deploying a given repository to a remote machine
Installation
composer require stekel/laravel-deploy
Laravel Version | Laravel-Deploy Version |
---|---|
v5.x | v1.x |
v6.x | v2.x |
v7.x | v3.x |
Create the config file
php artisan vendor:publish --provider="stekel\LaravelDeploy\Laravel\Providers\LaravelDeployServiceProvider"
Create a site configuration class
<?php namespace App; use stekel\LaravelDeploy\Site; class SampleSite extends Site { public function prod() { $this->ssh('192.168.1.100, admin, password, function ($connection) { $connection->command('git reset --hard'); $connection->command('git pull'); $connection->command('composer install --optimize-autoloader --no-dev'); $connection->command('php artisan migrate'); $connection->command('php artisan cache:clear'); $connection->command('php artisan config:cache'); $connection->command('php artisan route:cache'); $connection->command('php artisan view:cache'); }); } }
Reference that class in the config
// ... 'sites' => [ 'sample-site' => \App\SampleSite::class, ], // ...
Reference the site/environment when deploying
// stekel:deploy {site} {environment}
stekel:deploy sample-site prod