From c46c09a947738626e26ae94c4091f8a977972725 Mon Sep 17 00:00:00 2001 From: Ayush Date: Tue, 25 Jul 2023 13:18:52 +0530 Subject: [PATCH 1/3] :sparkles: feature laravel envoy --- Envoy.blade.php | 15 ++++++++++++ composer.json | 1 + composer.lock | 64 ++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 Envoy.blade.php diff --git a/Envoy.blade.php b/Envoy.blade.php new file mode 100644 index 0000000..c7790c4 --- /dev/null +++ b/Envoy.blade.php @@ -0,0 +1,15 @@ +@servers(['localhost' => '127.0.0.1']) + +@story('deploy', ['on' => 'localhost']) + composer + migrate +@endstory + + +@task('composer') + composer install +@endtask + +@task('migrate') + php artisan migrate +@endtask diff --git a/composer.json b/composer.json index e3380fd..6bcea66 100644 --- a/composer.json +++ b/composer.json @@ -18,6 +18,7 @@ "require-dev": { "fakerphp/faker": "^1.9.1", "laravel/breeze": "^1.21", + "laravel/envoy": "^2.8", "laravel/pint": "^1.0", "laravel/sail": "^1.18", "mockery/mockery": "^1.4.4", diff --git a/composer.lock b/composer.lock index 94ff675..704519e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c86a9f64d4bfbdaa90f064b7db116663", + "content-hash": "957486970678d3071ca25fd6734d5bc2", "packages": [ { "name": "brick/math", @@ -6299,6 +6299,68 @@ }, "time": "2023-06-16T21:23:43+00:00" }, + { + "name": "laravel/envoy", + "version": "v2.8.6", + "source": { + "type": "git", + "url": "https://github.com/laravel/envoy.git", + "reference": "24d2405dc785649684ccf531fddd2ac1f58ec861" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/envoy/zipball/24d2405dc785649684ccf531fddd2ac1f58ec861", + "reference": "24d2405dc785649684ccf531fddd2ac1f58ec861", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^6.0|^7.0", + "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0", + "php": "^7.2|^8.0", + "symfony/console": "^4.3|^5.0|^6.0", + "symfony/process": "^4.3|^5.0|^6.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.0|^9.0" + }, + "suggest": { + "ext-posix": "Required to determine the System user on Unix systems." + }, + "bin": [ + "bin/envoy" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Laravel\\Envoy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Elegant SSH tasks for PHP.", + "keywords": [ + "laravel", + "ssh" + ], + "support": { + "issues": "https://github.com/laravel/envoy/issues", + "source": "https://github.com/laravel/envoy/tree/v2.8.6" + }, + "time": "2023-01-10T19:27:26+00:00" + }, { "name": "laravel/pint", "version": "v1.10.3", From d7bebfeae0b7c83a956367301f6b76aa5523111b Mon Sep 17 00:00:00 2001 From: Ayush Date: Tue, 25 Jul 2023 21:21:18 +0530 Subject: [PATCH 2/3] :zap: add the some more commands which is use to installation time --- Envoy.blade.php | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Envoy.blade.php b/Envoy.blade.php index c7790c4..48aebeb 100644 --- a/Envoy.blade.php +++ b/Envoy.blade.php @@ -1,15 +1,14 @@ -@servers(['localhost' => '127.0.0.1']) +@servers(['localhost' => '127.0.0.1', 'staging' => '', 'production' => '']) -@story('deploy', ['on' => 'localhost']) - composer - migrate -@endstory - - -@task('composer') +@task('installation', ['on' => 'localhost']) composer install -@endtask - -@task('migrate') + cp .env.example .env + php artisan key:generate php artisan migrate + php artisan db:seed @endtask + +{{-- Running Command --}} + +{{-- php vendor/bin/envoy run installation --}} + From b151ebf6776aa09458a5887d8b5e4880eaebb263 Mon Sep 17 00:00:00 2001 From: Ayush Date: Sun, 6 Aug 2023 23:12:46 +0530 Subject: [PATCH 3/3] :art: add the more change in the envoy file --- Envoy.blade.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Envoy.blade.php b/Envoy.blade.php index 48aebeb..ff964f6 100644 --- a/Envoy.blade.php +++ b/Envoy.blade.php @@ -1,14 +1,13 @@ -@servers(['localhost' => '127.0.0.1', 'staging' => '', 'production' => '']) +@servers(['staging' => '', 'production' => '']) -@task('installation', ['on' => 'localhost']) - composer install - cp .env.example .env - php artisan key:generate +@task('staging-deployment') + php artisan down + git pull origin main + composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --optimize-autoloader + composer dump-autoload php artisan migrate - php artisan db:seed + php artisan optimize:clear + php artisan up @endtask -{{-- Running Command --}} - -{{-- php vendor/bin/envoy run installation --}}