From 4b772901345040e35fc854f425826451a7f4fa31 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 20 Mar 2022 21:54:01 +0100 Subject: [PATCH] CI: Fix k8s deployment when commit message contains a # or \, add more app dirs to whoops handler --- .gitlab-ci.yml | 5 ++++- src/Exceptions/Handlers/Whoops.php | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a1208007..12a9eabc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -343,7 +343,10 @@ deploy: - export CI_SETUP_ADMIN_PASSWORD=${CI_SETUP_ADMIN_PASSWORD} - cp deployment.tpl.yaml deployment.yaml - - for env in ${!CI_*}; do sed -i "s#<${env}>#$(echo "${!env}"|head -n1)#g" deployment.yaml; done + - >- + for env in ${!CI_*}; do + sed -i "s#<${env}>#$( echo "${!env}" | head -n1 | sed -e 's~\\~\\\\~' -e 's~#~\\#~' )#g" deployment.yaml; + done - echo "Deploying to ${CI_ENVIRONMENT_URL}" - kubectl apply -f deployment.yaml diff --git a/src/Exceptions/Handlers/Whoops.php b/src/Exceptions/Handlers/Whoops.php index 72e97776..d328b6af 100644 --- a/src/Exceptions/Handlers/Whoops.php +++ b/src/Exceptions/Handlers/Whoops.php @@ -52,10 +52,17 @@ class Whoops extends Legacy implements HandlerInterface */ protected function getPrettyPageHandler(Throwable $e) { + /** @var PrettyPageHandler $handler */ $handler = $this->app->make(PrettyPageHandler::class); $handler->setPageTitle('Just another ' . get_class($e) . ' to fix :('); - $handler->setApplicationPaths([realpath(__DIR__ . '/../..')]); + $handler->setApplicationPaths([ + realpath(__DIR__ . '/../..'), + realpath(__DIR__ . '/../../../includes/'), + realpath(__DIR__ . '/../../../db/'), + realpath(__DIR__ . '/../../../tests/'), + realpath(__DIR__ . '/../../../public/'), + ]); $data = $this->getData(); $handler->addDataTable('Application', $data);