From fbe549b82e8f48bf7de1372bfc60b8d5ed378da8 Mon Sep 17 00:00:00 2001 From: Thomas Nabord Date: Fri, 22 Nov 2024 15:28:13 +0000 Subject: [PATCH] Add healthcheck in PHP back end of Storybook and handle new env var PS_APP_VERSION --- storybook/.env | 1 + storybook/config/services.yaml | 1 + .../src/Controller/HealthCheckController.php | 20 +++++++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 storybook/src/Controller/HealthCheckController.php diff --git a/storybook/.env b/storybook/.env index ad8265a1f..f1c6ef070 100644 --- a/storybook/.env +++ b/storybook/.env @@ -17,4 +17,5 @@ ###> symfony/framework-bundle ### APP_ENV=dev APP_SECRET=6ca3f5a44d55f1407362700a7565930c +PS_APP_VERSION=dev ###< symfony/framework-bundle ### diff --git a/storybook/config/services.yaml b/storybook/config/services.yaml index 7d93bae36..41d83a53b 100644 --- a/storybook/config/services.yaml +++ b/storybook/config/services.yaml @@ -1,5 +1,6 @@ # https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration parameters: + app.version: '%env(PS_APP_VERSION)%' services: _defaults: diff --git a/storybook/src/Controller/HealthCheckController.php b/storybook/src/Controller/HealthCheckController.php new file mode 100644 index 000000000..9ae6348cf --- /dev/null +++ b/storybook/src/Controller/HealthCheckController.php @@ -0,0 +1,20 @@ + 'ok', + 'version' => $this->getParameter('app.version'), + ]); + } +}