From 272c0c9edb027486e8963322e46cf0351d8246da Mon Sep 17 00:00:00 2001 From: Arne Brasseur Date: Sat, 20 Jul 2024 10:36:40 +0200 Subject: [PATCH] Log failed health check to discord _before_ exiting --- ops/pre-receive.bb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ops/pre-receive.bb b/ops/pre-receive.bb index 09172e9..6014839 100755 --- a/ops/pre-receive.bb +++ b/ops/pre-receive.bb @@ -9,7 +9,7 @@ '[cheshire.core :as json] '[babashka.curl :as curl]) -(def timeout 120) +(def timeout 90) (def service-name "compass") (def health-check-url "http://localhost:8080/health") (def app-dir "/home/compass/app") @@ -155,14 +155,14 @@ (println (color 33 "Health check failed, reverting")) (sh "ln" "-sf" old-link current-dir) (systemctl "restart") - (fatal "Health check failed") (notify-discord (str "> __**Deployment health check failed, reverted.**__\n" "> ```\n" (->> (str/split log-lines #"\R") (map #(str "> " %)) (str/join "\n")) - "> ```"))) + "> ```")) + (fatal "Health check failed")) (do (notify-discord (str "> __**Deployed " sha "**__\n"