From b7037844a4897728a9d68573856f88cae80a9a8d Mon Sep 17 00:00:00 2001 From: Felipe Albert Date: Thu, 18 Aug 2022 17:24:37 -0300 Subject: [PATCH 1/4] support a custom manifest file --- config/vapor-ui.php | 13 +++++++++++++ src/Support/Cloud.php | 2 +- tests/Integration/Home/Title.php | 11 +++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/config/vapor-ui.php b/config/vapor-ui.php index cb6797e..24f55ab 100644 --- a/config/vapor-ui.php +++ b/config/vapor-ui.php @@ -65,4 +65,17 @@ ], + /* + |-------------------------------------------------------------------------- + | Vapor Manifest file + |-------------------------------------------------------------------------- + | + | This is where you will set the path of your custom manifest file. + | By default, Vapor-ui reads the vapor.yml file, but if in your application + | you need a custom file, you define the path and name of the file here + | + */ + + 'manifest_file' => env('VAPOR_MANIFEST_FILE', base_path('vapor.yml')), + ]; diff --git a/src/Support/Cloud.php b/src/Support/Cloud.php index 8db06c1..81974d8 100644 --- a/src/Support/Cloud.php +++ b/src/Support/Cloud.php @@ -63,7 +63,7 @@ public static function guessQueues() return []; } - $vapor = (new Parser)->parse(file_get_contents(base_path('vapor.yml'))); + $vapor = (new Parser)->parse(file_get_contents(config('vapor-ui.manifest_file'))); $environment = config('vapor-ui.environment'); diff --git a/tests/Integration/Home/Title.php b/tests/Integration/Home/Title.php index 2ef157d..6d748ca 100644 --- a/tests/Integration/Home/Title.php +++ b/tests/Integration/Home/Title.php @@ -10,3 +10,14 @@ "Vapor UI - $project - $environment" ); }); + +test('content with custom manifest', function () { + File::put(base_path('deploy/production/vapor.yml'), ''); + + $project = $_ENV['VAPOR_PROJECT']; + $environment = $_ENV['VAPOR_ENVIRONMENT']; + + $this->get('/vapor-ui')->assertSee( + "Vapor UI - $project - $environment" + ); +}); From 6f728337dfb8637a58349efa3386884a4a17d8a6 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 19 Aug 2022 10:02:38 -0500 Subject: [PATCH 2/4] Update vapor-ui.php --- config/vapor-ui.php | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/config/vapor-ui.php b/config/vapor-ui.php index 24f55ab..cb6797e 100644 --- a/config/vapor-ui.php +++ b/config/vapor-ui.php @@ -65,17 +65,4 @@ ], - /* - |-------------------------------------------------------------------------- - | Vapor Manifest file - |-------------------------------------------------------------------------- - | - | This is where you will set the path of your custom manifest file. - | By default, Vapor-ui reads the vapor.yml file, but if in your application - | you need a custom file, you define the path and name of the file here - | - */ - - 'manifest_file' => env('VAPOR_MANIFEST_FILE', base_path('vapor.yml')), - ]; From f192e82f76de3c4c1b627e2844962ec1e1b71f9d Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 19 Aug 2022 10:02:54 -0500 Subject: [PATCH 3/4] Update Cloud.php --- src/Support/Cloud.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Support/Cloud.php b/src/Support/Cloud.php index 81974d8..f17dcd0 100644 --- a/src/Support/Cloud.php +++ b/src/Support/Cloud.php @@ -63,7 +63,7 @@ public static function guessQueues() return []; } - $vapor = (new Parser)->parse(file_get_contents(config('vapor-ui.manifest_file'))); + $vapor = (new Parser)->parse(file_get_contents(config('vapor-ui.manifest'))); $environment = config('vapor-ui.environment'); From 4d94ce6f13c20febd61fadb052927b82f5d0cf5f Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 19 Aug 2022 10:03:07 -0500 Subject: [PATCH 4/4] Update Cloud.php --- src/Support/Cloud.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Support/Cloud.php b/src/Support/Cloud.php index f17dcd0..dce4f41 100644 --- a/src/Support/Cloud.php +++ b/src/Support/Cloud.php @@ -63,7 +63,7 @@ public static function guessQueues() return []; } - $vapor = (new Parser)->parse(file_get_contents(config('vapor-ui.manifest'))); + $vapor = (new Parser)->parse(file_get_contents(config('vapor-ui.manifest', base_path('vapor.yml')))); $environment = config('vapor-ui.environment');