diff --git a/.env.example b/.env.example index 4766ed1..46c4957 100644 --- a/.env.example +++ b/.env.example @@ -67,3 +67,9 @@ SLACK_ENABLED=true SLACK_CLIENT_TOKEN= SLACK_SIGNING_SECRET= SLACK_DEFAULT_CHANNEL="#general" + +HEROKU_RELEASE_VERSION=v01 +HEROKU_SLUG_DESCRIPTION="Dev 643f546" +HEROKU_RELEASE_CREATED_AT=2022-07-04T18:05:46Z +HEROKU_SLUG_COMMIT=643f546142b8a2db342f0ae46f01e61dce03e97c +GITHUB_REPO_URL=https://github.com/blumilksoftware/toby/ diff --git a/app/Infrastructure/Http/Middleware/HandleInertiaRequests.php b/app/Infrastructure/Http/Middleware/HandleInertiaRequests.php index 664c065..decaeb4 100644 --- a/app/Infrastructure/Http/Middleware/HandleInertiaRequests.php +++ b/app/Infrastructure/Http/Middleware/HandleInertiaRequests.php @@ -6,6 +6,7 @@ namespace Toby\Infrastructure\Http\Middleware; use Closure; use Illuminate\Http\Request; +use Illuminate\Support\Carbon; use Inertia\Middleware; use Toby\Domain\VacationRequestStatesRetriever; use Toby\Eloquent\Helpers\YearPeriodRetriever; @@ -25,6 +26,7 @@ class HandleInertiaRequests extends Middleware "flash" => $this->getFlashData($request), "years" => $this->getYearsData($request), "vacationRequestsCount" => $this->getVacationRequestsCount($request), + "deployInformation" => $this->getDeployInformation(), ]); } @@ -71,4 +73,17 @@ class HandleInertiaRequests extends Middleware ->count() : null; } + + protected function getDeployInformation(): array + { + $releaseDate = config("heroku.release_created_at"); + + return [ + "release_version" => config("heroku.release_version"), + "slug_description" => config("heroku.slug_description"), + "release_created_at" => $releaseDate ? Carbon::parse($releaseDate)->format('Y-m-d H:i:s') : null, + "slug_commit" => config("heroku.slug_commit"), + "github_url" => preg_replace("/\/$/i", "", config("heroku.github_url", "")), + ]; + } } diff --git a/config/heroku.php b/config/heroku.php new file mode 100644 index 0000000..dce537b --- /dev/null +++ b/config/heroku.php @@ -0,0 +1,11 @@ + env("HEROKU_RELEASE_VERSION"), + "slug_description" => env("HEROKU_SLUG_DESCRIPTION"), + "release_created_at" => env("HEROKU_RELEASE_CREATED_AT"), + "slug_commit" => env("HEROKU_SLUG_COMMIT"), + "github_url" => env("GITHUB_REPO_URL") +]; diff --git a/resources/js/Shared/Layout/AppLayout.vue b/resources/js/Shared/Layout/AppLayout.vue index 58a0851..af2fa7c 100644 --- a/resources/js/Shared/Layout/AppLayout.vue +++ b/resources/js/Shared/Layout/AppLayout.vue @@ -9,6 +9,30 @@
+ Wydanie: + + {{ deployInformation.slug_description }} ({{ deployInformation.release_version }}) + + + {{ deployInformation.slug_description }} + + ; +
++ Data wydania: {{ deployInformation.release_created_at }}; +
++ Wydanie: + + {{ deployInformation.slug_description }} ({{ deployInformation.release_version }}) + + + {{ deployInformation.slug_description }} + +
++ Data wydania: {{ deployInformation.release_created_at }} +
+